/* Auth modals: compact, high-contrast and touch friendly. Loaded after the app bundle. */
.modal-overlay {
  background: rgba(3, 10, 7, .78) !important;
  -webkit-backdrop-filter: blur(14px) saturate(125%) !important;
  backdrop-filter: blur(14px) saturate(125%) !important;
  padding: clamp(12px, 3vw, 28px) !important;
}

.modal-container {
  width: min(100%, 440px) !important;
  min-width: 0 !important;
  max-height: min(760px, calc(100dvh - 24px)) !important;
  overflow: auto !important;
  border: 1px solid rgba(0, 232, 122, .28) !important;
  border-radius: 24px !important;
  padding: 26px 26px 22px !important;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 232, 122, .13), transparent 38%),
    linear-gradient(160deg, #14241c 0%, #0a1410 72%) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .62), 0 0 0 1px rgba(255, 255, 255, .04) inset !important;
}

.modal-container::before {
  content: "";
  display: block;
  height: 3px;
  margin: -26px -26px 22px;
  background: linear-gradient(90deg, #00e87a, #f5b700, #00e87a);
}

.modal-close-btn {
  top: 14px !important;
  right: 14px !important;
  width: 36px !important;
  height: 36px !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, .08) !important;
  color: rgba(255, 255, 255, .86) !important;
  font-size: 0 !important;
  z-index: 2;
}

.modal-close-btn::before { content: "×"; font-size: 1.35rem; line-height: 1; }
.modal-close-btn:hover, .modal-close-btn:focus-visible { background: rgba(0, 232, 122, .2) !important; border-color: rgba(0, 232, 122, .7) !important; transform: none !important; }

.logo-header {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 4px 36px 20px !important;
}
.logo-image { width: min(156px, 60vw) !important; max-height: 52px; object-fit: contain; }
.login-form .logo-header::after, .register-form .logo-header::after {
  display: block;
  color: #f3fbf6;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-align: center;
}
.login-form .logo-header::after { content: "Entre na sua conta"; }
.register-form .logo-header::after { content: "Crie sua conta"; }

.form-container { margin-top: 0 !important; }
.login-form-content, .register-form-content { gap: 12px !important; }
.input-group {
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, .15) !important;
  border-radius: 14px !important;
  background: rgba(2, 10, 6, .42) !important;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease !important;
}
.input-group:focus-within {
  border-color: #00e87a !important;
  box-shadow: 0 0 0 3px rgba(0, 232, 122, .15) !important;
  background: rgba(2, 18, 10, .7) !important;
}
.input-icon {
  width: 48px !important;
  height: 54px !important;
  flex: 0 0 48px;
  border-right: 0 !important;
  background: transparent !important;
}
.input-icon svg { opacity: .9; }
.form-input {
  min-width: 0;
  height: 54px !important;
  padding: 0 14px !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 16px !important;
  color: #f4fff7 !important;
}
.form-input::placeholder { margin-left: 0 !important; color: rgba(231, 245, 236, .58) !important; }
.form-input:-webkit-autofill { -webkit-text-fill-color: #f4fff7; box-shadow: 0 0 0 100px #102119 inset; }
.password-toggle { top: 0 !important; right: 8px !important; height: 54px !important; width: 42px; padding: 0 !important; color: #dceee3 !important; }
.password-toggle:focus-visible { outline: 2px solid #00e87a; outline-offset: -4px; border-radius: 10px; }
.password-toggle + .form-input, .input-group:has(.password-toggle) .form-input { padding-right: 50px !important; }
.phone-cc { border-right: 1px solid rgba(255, 255, 255, .12) !important; }
.phone-dial { color: #dff7e8 !important; }

.forgot-password {
  align-self: flex-end;
  color: #9de9b9 !important;
  font-size: .8rem !important;
  line-height: 1.3 !important;
  padding: 5px 2px !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.forgot-password:hover { color: #fff !important; }
.terms-text {
  margin: 2px 0 4px !important;
  padding: 10px 12px !important;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  color: rgba(237, 248, 240, .72) !important;
  font-size: .76rem !important;
  line-height: 1.45 !important;
}
.terms-link { color: #9de9b9 !important; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

.submit-section { margin-top: 4px; }
.submit-btn {
  min-height: 52px !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: linear-gradient(135deg, #00e87a, #00b85c) !important;
  color: #03130a !important;
  font-size: .96rem !important;
  font-weight: 900 !important;
  letter-spacing: .01em !important;
  text-transform: none !important;
  box-shadow: 0 12px 28px rgba(0, 184, 92, .25) !important;
}
.submit-btn:hover:not(:disabled), .submit-btn:focus-visible { background: linear-gradient(135deg, #29f58f, #00c968) !important; transform: translateY(-1px) !important; box-shadow: 0 15px 32px rgba(0, 232, 122, .3) !important; }
.submit-btn:focus-visible { outline: 3px solid rgba(245, 183, 0, .8); outline-offset: 3px; }
.login-link, .register-link { margin: 16px 0 0 !important; color: rgba(237, 248, 240, .68); font-size: .82rem !important; line-height: 1.45 !important; }
.login-link-text, .register-link-text { color: #b4f3c9 !important; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.error-messages, .general-error { border-radius: 12px !important; margin: 0 !important; }

@media (max-width: 560px) {
  .modal-overlay { align-items: flex-end !important; padding: 8px !important; }
  .modal-container { width: 100% !important; max-height: calc(100dvh - 16px) !important; border-radius: 22px !important; padding: 22px 18px 18px !important; }
  .modal-container::before { margin: -22px -18px 18px; }
  .logo-header { padding: 2px 34px 16px !important; }
  .logo-image { width: 142px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .modal-container { animation: none !important; }
  .submit-btn { transition: none !important; }
}
