/* ==========================================================================
   SEVILLA360 - Auth Page Specific Styles
   ========================================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-attachment: fixed; /* subtle parallax on scroll */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}


.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo {
  font-family: var(--font-heading);
  font-size: 3rem;
  color: var(--color-gold);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.auth-tagline {
  font-family: var(--font-body);
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.85rem;
}

.auth-card {
  background-color: var(--color-white);
  padding: 3rem;
  border-radius: 0; /* Changed to 0 for luxury feel */
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-gold);
  width: 100%;
  max-width: 480px;
  position: relative;
  overflow: hidden;
}

.auth-view {
  display: none;
  animation: fadeIn 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.auth-view.active {
  display: block;
}

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

.auth-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--color-dark-light);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--color-dark);
}

/* Gray boxes for input fields */
.form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 0; /* Changed to 0 */
  font-family: var(--font-body);
  font-size: 0.95rem;
  background-color: #f5f5f5;
  color: var(--color-dark);
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-gold);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(214, 168, 112, 0.1);
}

.form-control::placeholder {
  color: #a09d9b;
}

/* Registration email feedback states. The message and symbols keep the state
   understandable without relying on the border color alone. */
.form-control.email-invalid {
  border-color: #a94f4b !important;
  box-shadow: 0 0 0 1px #a94f4b !important;
}

.form-control.email-invalid:focus {
  border-color: #8f3f3b !important;
  box-shadow: 0 0 0 3px rgba(169, 79, 75, 0.2) !important;
}

.form-control.email-valid {
  border-color: #3f7355 !important;
  box-shadow: 0 0 0 1px #3f7355 !important;
}

.form-control.email-valid:focus {
  border-color: #315d44 !important;
  box-shadow: 0 0 0 3px rgba(63, 115, 85, 0.2) !important;
}

.email-feedback {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
  font-weight: 500;
}

.email-feedback[hidden] {
  display: none;
}

.email-feedback::before {
  display: inline-flex;
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.email-feedback-invalid {
  color: #a94f4b;
}

.email-feedback-invalid::before {
  content: "!";
}

.email-feedback-valid {
  color: #3f7355;
}

.email-feedback-valid::before {
  content: "✓";
}

.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 78px;
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-dark-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: var(--transition-smooth);
}

.password-toggle:hover {
  color: var(--color-gold);
}

.forgot-link {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: right;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: var(--color-dark-light);
  font-family: inherit;
}

.forgot-link:hover {
  color: var(--color-gold);
}

.forgot-link:focus-visible,
.recovery-nudge-action:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

.login-recovery-nudge {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: -0.5rem 0 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-gold);
  background: #fff8ef;
  color: var(--color-dark);
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
}

.recovery-nudge-action {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
}

.recovery-nudge-action:hover {
  color: var(--color-gold);
}

.btn-full {
  width: 100%;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--color-dark-light);
}

.auth-footer a {
  color: var(--color-gold);
  font-weight: 500;
  cursor: pointer;
}

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

.terms-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--color-dark-light);
}

.terms-checkbox-group input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--color-gold);
  cursor: pointer;
}

.terms-link {
  color: var(--color-gold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
}
.terms-link:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 3px; }

.terms-content {
  font-size: 0.9rem;
  color: var(--color-dark-light);
  margin-bottom: 2rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 10px;
}

.terms-content ol {
  padding-left: 1.2rem;
}

.terms-content li {
  margin-bottom: 1rem;
}

.terms-content li strong {
  color: var(--color-dark);
}

.back-home-btn {
  position: absolute;
  top: 2.5rem;
  left: 2.5rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  transition: var(--transition-smooth);
  z-index: 10;
}

.back-home-btn:hover {
  color: var(--color-gold);
  transform: translateX(-5px);
}

@media (max-width: 768px) {
  .auth-page {
    background-attachment: scroll; /* fixed can jitter/scroll-jank on mobile */
  }

  .back-home-btn {
    position: relative;
    top: 0;
    left: 0;
    align-self: flex-start;
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
  }

  .auth-page {
    justify-content: flex-start;
    padding: 1.5rem 1.25rem 2rem;
  }

  .auth-header {
    margin-bottom: 1.75rem;
  }

  .auth-logo {
    font-size: 2.7rem;
  }

  .auth-tagline {
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    line-height: 1.5;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }

  .auth-subtitle {
    margin-bottom: 1.5rem;
  }

  .form-group {
    margin-bottom: 1.25rem;
  }

  .auth-footer {
    margin-top: 1.5rem;
  }
}
/* Two stages: complete account details, then verify the email. */
.registration-progress {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--color-dark-light);
}

.registration-progress li {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.6rem;
  border-bottom: 2px solid #ded9d1;
}
.register-step[hidden] { display: none; }
.register-back {
  display: block;
  margin: 14px auto 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--color-dark-light);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.register-back:focus-visible,
.verification-modal { box-sizing: border-box; padding: 16px; overflow-y: auto; }
.verification-card { box-sizing: border-box; max-height: calc(100dvh - 32px); overflow-y: auto; }
#verification-code-panel[hidden], #verification-change-panel[hidden], .verification-status[hidden] { display: none; }
.verification-status { margin: 0 0 14px; padding: 10px 12px; background: #f9e8e5; color: #8b3631; text-align: left; line-height: 1.45; font-size: .9rem; }
.verification-status.is-success { background: #e9f2eb; color: #285a3b; }
.verification-text-button { display: block; margin: 16px auto 0; border: 0; background: transparent; color: var(--color-dark-light); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.verification-text-button:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 3px; }

.registration-progress li[aria-current="step"],
.registration-progress li.is-complete {
  color: var(--color-dark);
  border-color: var(--color-gold);
  font-weight: 600;
}

.registration-progress span { font-variant-numeric: tabular-nums; }
.registration-name-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.registration-next-note, .verification-status {
  color: var(--color-dark-light);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.auth-text-button, button.terms-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-dark);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.auth-text-button:hover, button.terms-link:hover { color: #805b30; }
.auth-back-button { display: block; margin-inline: auto; padding: 0.6rem; }
.password-toggle { border: 0; background: transparent; font-family: inherit; min-height: 44px; }
.auth-text-button:focus-visible, .terms-link:focus-visible,
.password-toggle:focus-visible, .verification-close:focus-visible {
  outline: 2px solid var(--color-dark);
  outline-offset: 3px;
}
.verification-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: var(--color-dark);
  font-size: 1.5rem;
  cursor: pointer;
}
#verification-modal { overflow-y: auto; padding: 1rem; }
#verification-modal .auth-card { max-height: calc(100dvh - 2rem); overflow-y: auto; }
#verify-email-display { overflow-wrap: anywhere; }
#resend-code-btn:disabled { cursor: wait; opacity: 0.65; }

@media (max-width: 480px) {
  .registration-name-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .form-control { font-size: 1rem; }
  .registration-progress { gap: 0.75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-view { animation: none; }
}
.recovery-channel-options {
  border: 0;
  margin: 0 0 20px;
  padding: 0;
}
.recovery-channel-options legend {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 9px;
}
.recovery-channel-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 8px;
  border: 1px solid #d8d1c5;
  border-radius: 5px;
  cursor: pointer;
}
.recovery-channel-options label:focus-within { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.recovery-channel-options input { accent-color: var(--color-gold); }
.recovery-code-link { margin-top: 16px; }

/* Grouped signup keeps one coherent task visible without shrinking controls. */
body:has(.auth-card.is-registering) { overflow: visible; }
.auth-card.is-registering { overflow: visible; }
.registration-group { padding: 0; margin: 0; }
.registration-group[hidden], .registration-step-actions[hidden], #registration-back[hidden] { display: none !important; }
.registration-group-title { margin: 0 0 1rem; font-size: 1.1rem; }
.registration-group-title:focus { outline: none; }
.registration-step-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding-block: 0.75rem 0.25rem;
  background: var(--color-white);
}
.registration-step-actions .btn-full { margin-bottom: 0.5rem; min-height: 44px; white-space: normal; }
.registration-group .form-control { scroll-margin-block: 1rem 7rem; }
.registration-progress li { align-items: baseline; min-width: 0; }
@media (max-width: 480px) {
  .registration-progress { gap: 0.5rem; font-size: 0.875rem; }
  #view-user-register .form-group { margin-bottom: 1rem; }
  #view-user-register .auth-subtitle { margin-bottom: 1.25rem; }
}
