/* ==========================================================================
   TECNVIRONS — Auth Modals (Login / Signup / Forgot / Reset / Verify)
   Ported from Tecnvirons-Website's src/components/modals/*.css (React).
   Email/password + plain phone field only — no Google OAuth, no
   react-phone-input-2 (that site is on a different domain and doesn't use
   either).
   ========================================================================== */

@keyframes authSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.auth-modal-overlay.active {
  display: flex;
}

.auth-modal-container {
  background: #fff;
  border-radius: 0px;
  overflow: hidden;
  display: flex;
  width: 900px;
  height: 600px;
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-modal-container.tall {
  height: 650px;
}

.auth-modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  color: #000;
}

.auth-modal-close-btn:hover {
  background: #fff;
  transform: scale(1.1);
}

/* Right side - image section */
.auth-modal-image-section {
  flex: 1.2;
  position: relative;
  overflow: hidden;
  padding: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.auth-modal-image-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.auth-image-overlay {
  position: absolute;
  top: 15px; left: 15px; right: 15px; bottom: 15px;
  border-radius: 16px;
}

.auth-decorative-shape {
  position: absolute;
  background: #fff;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-top-left-shape {
  top: -15px; left: -15px;
  width: 95px; height: 55px;
  border-radius: 0 0 8px 0;
}

.auth-bottom-right-shape {
  bottom: -15px; right: -15px;
  width: 80px; height: 40px;
  border-radius: 8px 0 0 0;
}

.auth-overlay-content {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  z-index: 2;
}

.auth-overlay-card,
.auth-bottom-overlay {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 24px;
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  max-width: 280px;
}

.auth-bottom-overlay {
  align-self: flex-end;
}

.auth-overlay-card h3,
.auth-bottom-overlay h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px 0;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-overlay-card p,
.auth-bottom-overlay p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Left side - form section */
.auth-modal-form-section {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
}

.auth-form-content {
  padding: 20px 24px 15px 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  box-sizing: border-box;
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.auth-modal-logo {
  margin-bottom: 12px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.auth-modal-logo img {
  width: 70px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
  display: block;
  margin: 0 auto;
}

.auth-modal-header h2 {
  margin: 12px 0 6px 0;
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  text-align: center;
  width: 100%;
}

/* Toggle: Sign Up / Log In pill row */
.auth-toggle {
  display: flex;
  gap: 5px;
  margin-bottom: 19px;
}

.auth-toggle-btn {
  flex: 1;
  padding: 10px 20px;
  border: 2px solid transparent;
  background: transparent;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.auth-toggle-btn.active {
  background: #8b5cf6;
  color: #fff;
  border: 2px solid #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.auth-toggle-btn:not(.active):hover {
  background: #f5f3ff;
  color: #8b5cf6;
  border: 2px solid #8b5cf6;
}

.auth-form-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.auth-form-title {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  text-align: center;
  line-height: 1.2;
}

.auth-form-subtitle {
  font-size: 15px;
  color: #666;
  margin: 0 0 20px 0;
  text-align: center;
  line-height: 1.4;
}

/* auth-type toggle (Email / Phone) */
.auth-type-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
}

.auth-type-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-type-btn.active {
  background: #7c3aed;
  color: #fff;
}

/* Form groups (floating label inputs) */
.auth-form-group {
  position: relative;
  margin-bottom: 12px;
}

.auth-form-group input {
  height: 48px;
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 0px;
  font-size: 14px;
  transition: all 0.25s ease;
  background: #fafbfc;
  box-sizing: border-box;
  display: block;
  font-weight: 500;
  color: #1a1a1a;
}

.auth-form-group input:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.auth-form-group input:focus + label,
.auth-form-group input:not(:placeholder-shown) + label {
  top: -9px;
  left: 12px;
  font-size: 12px;
  color: #6366f1;
  background: #fff;
  padding: 0 4px;
  font-weight: 600;
}

.auth-form-group label {
  position: absolute;
  top: 13px;
  left: 14px;
  font-size: 14px;
  color: #999;
  font-weight: 500;
  transition: all 0.25s ease;
  pointer-events: none;
  background: transparent;
}

.auth-form-group input::placeholder {
  color: transparent;
}

.auth-password-wrapper {
  position: relative;
}

.auth-password-wrapper input {
  padding-right: 40px;
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 2;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.auth-password-toggle:hover {
  color: #8b5cf6;
}

.auth-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 10px 0;
  gap: 12px;
}

.auth-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.auth-checkbox-row.align-start {
  align-items: flex-start;
}

.auth-custom-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  flex-shrink: 0;
  background: #fff;
  border: 2.5px solid #8b5cf6;
  border-radius: 4px;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  margin: 2px 0 0 0;
}

.auth-custom-checkbox:hover {
  border-color: #7c3aed;
  background-color: #f5f3ff;
}

.auth-custom-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

.auth-custom-checkbox:checked {
  background: #8b5cf6;
  border-color: #8b5cf6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
}

.auth-checkbox-label {
  font-size: 14px;
  color: #1a202c;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
  line-height: 1.5;
}

.auth-checkbox-label a {
  color: #8b5cf6;
  text-decoration: none;
  font-weight: 600;
}

.auth-checkbox-label a:hover {
  text-decoration: underline;
}

.auth-forgot-btn {
  background: none;
  border: none;
  color: #8b5cf6;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
  padding: 0;
}

.auth-forgot-btn:hover {
  color: #7c3aed;
  text-decoration: underline;
}

.auth-submit-btn {
  background: #8b5cf6;
  color: #fff;
  border: none;
  padding: 15px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
}

.auth-submit-btn:hover:not(:disabled) {
  background: #7c3aed;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-error-message {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.auth-success-message {
  background: #ecfdf3;
  color: #067647;
  border: 1.5px solid #abefc6;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.auth-field-error {
  color: #dc2626;
  font-size: 11px;
  margin-top: 4px;
  display: block;
  animation: authSlideDown 0.2s ease;
}

.auth-form-footer {
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid #e5e5e5;
  margin-top: 8px;
}

.auth-form-footer p {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.5;
  padding: 6px 0 0 0;
}

.auth-link-btn {
  background: none;
  border: none;
  color: #8b5cf6;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  display: inline-block;
}

.auth-link-btn:hover {
  color: #7c3aed;
  background: rgba(139, 92, 246, 0.08);
}

.auth-verify-btn {
  background: #8b5cf6;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.auth-verify-btn:hover {
  background: #7c3aed;
}

/* Password requirements checklist (Reset Password modal) */
.auth-password-requirements {
  margin: 4px 0 14px 0;
  padding: 12px 14px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.auth-password-requirements h4 {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin: 0 0 8px 0;
}

.auth-requirements-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.auth-requirements-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #9ca3af;
}

.auth-requirements-list li.met {
  color: #16a34a;
}

/* OTP delivery method selector (SMS / WhatsApp) */
.auth-otp-method-box {
  padding: 16px;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8ebff 100%);
  border-radius: 8px;
  margin-bottom: 15px;
  border: 2px solid #e0e7ff;
}

.auth-otp-method-box p {
  margin: 0 0 12px 0;
  font-weight: 700;
  color: #4338ca;
  font-size: 13px;
  text-align: center;
}

.auth-otp-method-row {
  display: flex;
  gap: 10px;
}

.auth-otp-method-btn {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid #ddd;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #4b5563;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.auth-otp-method-btn.sms.active {
  border-color: #0084ff;
  background: linear-gradient(135deg, #0084ff 0%, #0066cc 100%);
  color: #fff;
}

.auth-otp-method-btn.whatsapp.active {
  border-color: #25d366;
  background: linear-gradient(135deg, #25d366 0%, #20ba5f 100%);
  color: #fff;
}

/* OTP digit inputs (Email Verification modal) */
.auth-otp-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.auth-otp-input {
  width: 48px;
  height: 54px;
  box-sizing: border-box;
  border: 1.5px solid #e0e0e0;
  border-radius: 0px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  background: #fafbfc;
  transition: all 0.25s ease;
  outline: none;
  color: #1a1a1a;
}

.auth-otp-input:focus {
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.auth-verification-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 0 0 10px 0;
}

.auth-resend-btn {
  background: #fff;
  border: 1.5px solid #8b5cf6;
  color: #8b5cf6;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 13px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.auth-resend-btn:hover:not(:disabled) {
  background: #f5f3ff;
}

.auth-resend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-instructions {
  margin-top: 8px;
}

.auth-instructions h4 {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.auth-instructions ul {
  padding-left: 18px;
  margin: 0;
  list-style: disc;
}

.auth-instructions li {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
  line-height: 1.4;
}

/* Forgot password: success state */
.auth-success-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.auth-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-success-content .auth-instructions {
  text-align: left;
  width: 100%;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .auth-modal-overlay {
    padding: 0;
  }

  .auth-modal-container {
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .auth-modal-image-section {
    display: none;
  }

  .auth-modal-form-section {
    flex: 1;
    padding: 15px;
    width: 100%;
    box-sizing: border-box;
  }

  .auth-form-title {
    font-size: 20px;
  }

  .auth-form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .auth-modal-close-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 99999;
    width: 30px;
    height: 30px;
  }

  .auth-otp-input {
    width: 40px;
    height: 46px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .auth-modal-container {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .auth-modal-form-section {
    padding: 12px;
  }

  .auth-form-content {
    padding: 12px 14px;
  }

  .auth-otp-inputs {
    gap: 6px;
  }

  .auth-otp-input {
    width: 34px;
    height: 42px;
    font-size: 14px;
  }

  .auth-verification-actions {
    grid-template-columns: 1fr;
  }
}
