/* ============================================================
   THAI.CONDOS — Redesign 2026 AUTH layer
   Scope: .modal-content:has(form.simple-form)
   Restyles login / register / forgot-password / reset-password
   pages by targeting the shared wrapper markup. No blade edits.
   Loaded AFTER redesign-tokens + redesign-components.
   ============================================================ */

/* Card surface — replace bare .modal-content with the redesign card. */
.modal-content:has(form.simple-form) {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-card-light);
  overflow: hidden;
  max-width: 520px;
  margin: 48px auto;
}
/* register card is two-column so allow it more breathing room */
.modal-content#sign-up {
  max-width: 720px;
}
.modal-content:has(form.simple-form) > .modal-body {
  padding: 36px 36px 32px;
}

/* Page title */
.modal-content:has(form.simple-form) h2 {
  font-family: var(--rd-font-display);
  font-size: clamp(26px, 2.4vw, 32px);
  font-weight: 700;
  color: var(--color-text-primary-light);
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}

/* Field labels */
.modal-content:has(form.simple-form) label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary-light);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* Inputs — rounded + soft border, matches redesign-account inputs. */
.modal-content:has(form.simple-form) .form-control,
.modal-content:has(form.simple-form) .input-with-icon input,
.modal-content:has(form.simple-form) select,
.modal-content:has(form.simple-form) textarea {
  border-radius: 10px;
  border: 1px solid var(--color-border-line, #e5e9ec);
  background: #fff;
  padding: 12px 14px 12px 42px;
  font-size: 14px;
  color: var(--color-text-primary-light);
  height: auto;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.modal-content:has(form.simple-form) .form-control:focus,
.modal-content:has(form.simple-form) .input-with-icon input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-dim, rgba(30, 44, 92, 0.12));
  outline: none;
}
/* Input icon positioning — wrapper is .input-with-icon. */
.modal-content:has(form.simple-form) .input-with-icon {
  position: relative;
}
.modal-content:has(form.simple-form) .input-with-icon > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted-light, #9aa3b2);
  font-size: 15px;
  pointer-events: none;
}

/* Selects on register page */
.modal-content:has(form.simple-form) .select2-container--default .select2-selection--single {
  border-radius: 10px;
  border-color: var(--color-border-line, #e5e9ec);
  height: 46px;
  padding: 8px 10px;
}

/* Checkbox row (Remember me) */
.modal-content:has(form.simple-form) .checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-primary-light);
  font-weight: 500;
}
.modal-content:has(form.simple-form) .checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent);
}

/* Inline links — navy with hover-underline, replaces legacy orange .link. */
.modal-content:has(form.simple-form) .link,
.modal-content:has(form.simple-form) a:not(.btn) {
  color: var(--color-accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.12s ease;
}
.modal-content:has(form.simple-form) .link:hover,
.modal-content:has(form.simple-form) a:not(.btn):hover {
  color: var(--color-accent-hover, var(--color-warm));
  text-decoration: underline;
}

/* Primary submit button — replaces pastel green .btn-theme-light-2.rounded.
   Legacy style.css pins `.btn.btn-theme-light-2 { bg/border/color !important }`
   so we have to match with !important to flip the palette. */
.modal-content:has(form.simple-form) .btn.btn-theme-light-2,
.modal-content:has(form.simple-form) .btn.btn-theme-light-2:focus,
.modal-content:has(form.simple-form) button[type="submit"],
.modal-content:has(form.simple-form) .btn-theme {
  background: var(--color-accent) !important;
  color: #fff !important;
  border: 1px solid var(--color-accent) !important;
  border-radius: 10px !important;
  padding: 13px 20px !important;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  width: 100%;
  transition: background 0.15s ease, transform 0.05s ease;
}
.modal-content:has(form.simple-form) .btn.btn-theme-light-2:hover,
.modal-content:has(form.simple-form) button[type="submit"]:hover {
  background: var(--color-accent-hover, #14224a) !important;
  border-color: var(--color-accent-hover, #14224a) !important;
  color: #fff !important;
  transform: translateY(-1px);
}
.modal-content:has(form.simple-form) .btn.btn-theme-light-2:active {
  transform: translateY(0);
}

/* Error / alert messages */
.modal-content:has(form.simple-form) .invalid-feedback,
.modal-content:has(form.simple-form) .text-danger {
  color: #d04545;
  font-size: 12px;
  margin-top: 4px;
  display: block;
}
.modal-content:has(form.simple-form) .alert {
  border-radius: 10px;
  border: 0;
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Captcha wrapper — let it sit naturally */
.modal-content:has(form.simple-form) > .modal-body .form-group:has(.g-recaptcha),
.modal-content:has(form.simple-form) > .modal-body .form-group:has(iframe[src*="recaptcha"]) {
  display: flex;
  justify-content: center;
}

/* "Don't have an account?" footer */
.modal-content:has(form.simple-form) .form-group.text-center p {
  font-size: 14px;
  color: var(--color-text-secondary-light);
  margin: 0;
}

/* LINE / social provider buttons appear AFTER the form via filter. Don't
   touch their inner branding — only normalise the container spacing. */
.modal-content:has(form.simple-form) .text-center > * {
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 600px) {
  .modal-content:has(form.simple-form) > .modal-body {
    padding: 24px 20px;
  }
  .modal-content:has(form.simple-form) {
    margin: 16px;
    /* Bootstrap base sets .modal-content { width: 100% }; combined with the
       16px side margins that overflows the row by a few px on phones. Let the
       card shrink to fill the row minus its margins instead. */
    width: auto;
  }
}
