/*
  Main styles for login and registration layouts.
  Author: Alfonso Shytani
  Created: 2026-01-30
*/

/* Base page layout */
.login-page {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  background: #ffffff; /* White background. */
  color: #000000; /* Black text. */
}

/* Background texture */
.noise {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 0); /* Black noise. */
  background-size: 120px 120px;
  opacity: 0.25;
  pointer-events: none;
}

/* Brand panel */
.brand-panel {
  position: relative;
  padding: 3rem;
  border-radius: 28px;
  background: var(--brand-blue); /* Primary blue panel. */
  color: #ffffff; /* White text. */
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25); /* Black shadow. */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  min-width: 0;
  animation: floatIn 0.8s ease-out;
}

/* Decorative circle removed */
.brand-panel::after {
  display: none; /* Remove halo circle. */
}

/* Badge and title */

.brand-logo {
  height: 54px; /* Logo height (1.7x). */
  width: auto; /* Keep aspect ratio. */
  display: block; /* Remove inline gap. */
}

.brand-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 0;
}

.brand-badge {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff; /* White dot. */
}

.brand-sub {
  font-size: 0.75rem;
  opacity: 0.8;
  overflow-wrap: anywhere;
}

.display-title {
  font-size: clamp(2.1rem, 6.4vw, 3rem);
  line-height: 1.12;
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.lead-text {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: min(100%, 420px);
  opacity: 0.9;
  overflow-wrap: anywhere;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.18); /* White glass. */
  padding: 1rem 1.2rem;
  border-radius: 16px;
}

.stat-number {
  font-size: 1.6rem;
  margin: 0 0 0.3rem;
  font-weight: 700;
}

.stat-label {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Card novita' */
.wave-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.15); /* Black overlay. */
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4); /* Light border. */
  min-width: 0;
}

.wave-title {
  margin: 0 0 0.3rem;
  font-weight: 600;
}

.wave-text {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
  overflow-wrap: anywhere;
}

/* Contenitore form */
.form-shell {
  background: #ffffff;
  border-radius: 28px;
  border: 2px solid #000000; /* Black border. */
  padding: 3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); /* Black shadow. */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  min-width: 0;
  animation: slideUp 0.8s ease-out;
}

/* Titoli form */
.form-header h2 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}

.form-header p {
  margin: 0;
  color: rgba(0, 0, 0, 0.65); /* Muted black. */
}

/* Layout form */
.login-form {
  display: grid;
  gap: 1rem;
}

.register-required-note {
  margin: 0 0 0.25rem;
  color: rgba(0, 0, 0, 0.66);
  font-size: 0.92rem;
  line-height: 1.55;
}

.form-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  font-weight: 600;
  color: #0f2b4d;
}

.required-indicator {
  color: #b82334;
  font-weight: 700;
}

/* Input personalizzati */
.custom-input {
  border-radius: 14px;
  padding: 0.9rem 1rem;
  border: 1px solid #000000; /* Black border. */
  background: #ffffff; /* White input. */
}

.custom-input:focus {
  border-color: var(--brand-blue); /* Blue focus. */
  box-shadow: 0 0 0 0.2rem rgba(0, 75, 135, 0.2); /* Blue focus glow. */
}

.custom-input.is-invalid,
.custom-input[aria-invalid="true"] {
  border-color: #b82334;
  box-shadow: 0 0 0 0.18rem rgba(184, 35, 52, 0.12);
}

.password-field {
  position: relative;
}

.password-input {
  padding-right: 3rem;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: rgba(0, 0, 0, 0.65);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
  color: var(--brand-blue);
  background: rgba(0, 75, 135, 0.08);
  outline: none;
}

/* Riga checkbox + link */
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.link-soft {
  color: var(--brand-blue); /* Blue link. */
  text-decoration: none;
}

.link-strong {
  color: #000000; /* Black link. */
  font-weight: 600;
  text-decoration: none;
}

/* Pulsante principale */
.custom-btn {
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: var(--brand-blue); /* Primary blue. */
  border: none;
  color: #ffffff; /* White text. */
  font-weight: 600;
}

.custom-btn:hover {
  background: #000000; /* Black hover. */
}

.custom-btn:active,
.custom-btn.is-touch-active {
  background: #000000;
}

/* Footer form */
.form-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.65); /* Muted black. */
}

.security-note {
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.55); /* Muted black. */
}

.turnstile-block {
  display: grid;
  gap: 0.5rem;
}

.turnstile-block .cf-turnstile {
  width: 100%;
}

.support-accordion {
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 18px;
  background: rgba(0, 75, 135, 0.03);
  overflow: hidden;
  max-width: 100%;
}

.support-accordion[open] {
  background: rgba(0, 75, 135, 0.05);
}

.support-accordion__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-blue);
}

.support-accordion__summary span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.support-accordion__summary::-webkit-details-marker {
  display: none;
}

.support-accordion__icon {
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.2s ease;
  flex: 0 0 auto;
}

.support-accordion[open] .support-accordion__icon {
  transform: rotate(180deg);
}

.support-accordion__content {
  padding: 0 1.15rem 1.15rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  min-width: 0;
}

.auth-resend-form {
  min-width: 0;
}

.auth-resend-form > * {
  min-width: 0;
}

.auth-resend-form .turnstile-block {
  min-width: 0;
}

.auth-resend-form .cf-turnstile {
  max-width: 100%;
}

.auth-resend-form .cf-turnstile > div,
.auth-resend-form .cf-turnstile iframe {
  max-width: 100% !important;
}

.auth-error-notice {
  margin: 0 0 1rem;
}

.auth-error-dialog {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(184, 35, 52, 0.18);
  background: linear-gradient(180deg, #fff7f7 0%, #fff0f1 100%);
  box-shadow: 0 14px 36px rgba(42, 10, 10, 0.12);
  padding: clamp(1rem, 3vw, 1.35rem);
  color: #5b121a;
}

.auth-error-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.78rem;
  border-radius: 999px;
  background: rgba(184, 35, 52, 0.12);
  color: #b82334;
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-error-head {
  margin: 0.8rem 0 0.35rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.auth-error-title {
  margin: 0;
  font-family: "kallisto", "Bai Jamjuree", system-ui, sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  line-height: 1.18;
  color: #7d1822;
}

.auth-error-copy {
  margin: 0;
  color: #7a2a32;
  font-size: 0.98rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.auth-error-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(184, 35, 52, 0.24);
  background: rgba(255, 255, 255, 0.7);
  color: #9a1f2e;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(143, 22, 36, 0.08);
}

.auth-error-close:hover,
.auth-error-close:focus {
  color: #7d1822;
  background: rgba(255, 255, 255, 0.92);
}

.auth-error-close:active,
.auth-error-close.is-touch-active {
  color: #7d1822;
  background: rgba(255, 255, 255, 0.92);
}

/* Alert bootstrap spacing */
.alert {
  margin-bottom: 0;
}

/* Animazioni */
@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Responsive */
@media (max-width: 991px) {
  .brand-panel {
    padding: 2.2rem;
  }

  .form-shell {
    padding: 2.2rem;
  }

  .wave-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .display-title {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }
}

@media (max-width: 575px) {
  .form-shell,
  .brand-panel {
    padding: 1.8rem;
  }

  .form-footer {
    flex-direction: column;
    gap: 0.5rem;
  }

  .support-accordion__summary {
    padding: 0.9rem 0.95rem;
    gap: 0.65rem;
    align-items: flex-start;
  }

  .support-accordion__summary span:first-child {
    line-height: 1.45;
  }

  .support-accordion__content {
    padding: 0 0.95rem 0.95rem;
  }

  .auth-resend-form {
    gap: 0.85rem;
  }

  .auth-resend-form .btn {
    width: 100%;
    min-height: 2.9rem;
  }

  .auth-error-dialog {
    border-radius: 20px;
    padding: 1.3rem;
  }

  .auth-error-close {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .support-accordion__summary {
    padding: 0.82rem 0.85rem;
  }

  .support-accordion__summary span:first-child {
    font-size: 0.96rem;
  }

  .support-accordion__content {
    padding: 0 0.85rem 0.85rem;
  }
}

@media (max-width: 420px) {
  .brand-panel,
  .form-shell {
    padding: 1.25rem;
    border-radius: 20px;
  }

  .brand-logo {
    height: 44px;
  }

  .brand-top {
    gap: 0.45rem;
  }

  .brand-badge,
  .brand-sub {
    font-size: 0.66rem;
  }

  .display-title {
    font-size: clamp(1.9rem, 13vw, 2.35rem);
    line-height: 1.08;
  }

  .lead-text {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .wave-card {
    gap: 0.85rem;
    padding: 1rem;
  }

  .form-header h2 {
    font-size: clamp(1.45rem, 9.5vw, 1.85rem);
  }

  .terms-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}


/* Admin dashboard */
.admin-page {
  min-height: 100vh;
  background: #ffffff; /* White admin background. */
  color: #000000; /* Black text. */
}

.admin-header h1 {
  font-size: 2.4rem;
  margin-bottom: 0.25rem;
}

.stat-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid #000000; /* Black border. */
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1); /* Black shadow. */
}

.stat-box h3 {
  margin: 0 0 0.25rem;
  font-size: 2rem;
}


/* Verify email page */
.verify-shell {
  background: #ffffff; /* White background. */
  color: #000000; /* Black text. */
  padding: 2rem; /* Internal spacing. */
  border-radius: 24px; /* Rounded container. */
  border: 2px solid #000000; /* Black border. */
  display: flex; /* Stack elements. */
  flex-direction: column; /* Vertical layout. */
  gap: 1.25rem; /* Space between elements. */
}

.verify-logo {
  width: 180px; /* Logo width. */
  height: auto; /* Keep aspect ratio. */
  filter: brightness(0) saturate(100%) invert(34%) sepia(88%) saturate(2476%) hue-rotate(191deg) brightness(93%) contrast(101%); /* Blue tint. */
}

.verify-btn {
  background: var(--brand-blue); /* Primary blue. */
  border-color: var(--brand-blue); /* Match border to blue. */
  color: #ffffff; /* White text. */
  font-weight: 600; /* Stronger label. */
}

.verify-btn:hover {
  background: #000000; /* Black hover. */
  border-color: #000000; /* Match hover border. */
  color: #ffffff; /* Keep white text. */
}

.verify-btn:active,
.verify-btn.is-touch-active {
  background: #000000;
  border-color: #000000;
  color: #ffffff;
}

.verify-outline {
  background: #ffffff; /* White background. */
  border: 2px solid var(--brand-blue); /* Blue outline. */
  color: var(--brand-blue); /* Blue text. */
  font-weight: 600; /* Emphasized label. */
}

.verify-outline:hover {
  background: var(--brand-blue); /* Blue fill on hover. */
  color: #ffffff; /* White text on hover. */
}

.verify-outline:active,
.verify-outline.is-touch-active {
  background: var(--brand-blue);
  color: #ffffff;
}

.verify-resend {
  border-top: 1px solid #000000; /* Separate section. */
  padding-top: 1.25rem; /* Space above section. */
  display: flex; /* Stack fields. */
  flex-direction: column; /* Vertical layout. */
  gap: 0.75rem; /* Spacing between inputs. */
}

.verify-resend h3 {
  margin: 0; /* Remove default margin. */
  font-size: 1.1rem; /* Slightly larger title. */
  color: #000000; /* Black title text. */
}


/* Terms and conditions */
.terms-section {
  display: grid; /* Stack checkboxes. */
  gap: 0.75rem; /* Spacing between rows. */
}

.terms-check {
  display: flex; /* Align checkbox and text. */
  align-items: flex-start; /* Align to top. */
  gap: 0.5rem; /* Space between checkbox and label. */
}


.terms-label {
  text-decoration: underline; /* Underlined text. */
  color: rgba(0, 0, 0, 0.6); /* Muted black. */
}

.terms-check.is-invalid {
  padding: 0.5rem 0.65rem;
  border-radius: 14px;
  border: 1px solid rgba(184, 35, 52, 0.3);
  background: rgba(184, 35, 52, 0.06);
}

.terms-link {
  display: inline; /* Keep underline continuous. */
  text-decoration: underline; /* Underlined link. */
  color: rgba(0, 0, 0, 0.6); /* Muted black. */
  background: transparent; /* No background. */
  border: none; /* No border. */
  padding: 0; /* Remove padding. */
  margin-left: 0.25rem; /* Space from text. */
  cursor: pointer; /* Pointer cursor. */
}


/* Terms modal overlay */
.terms-modal {
  position: fixed; /* Fixed overlay. */
  inset: 0; /* Full screen. */
  background: rgba(0, 0, 0, 0.6); /* Black overlay. */
  display: flex; /* Center modal. */
  align-items: center; /* Vertical center. */
  justify-content: center; /* Horizontal center. */
  z-index: 2000; /* On top. */
}

.terms-modal-content {
  background: #ffffff; /* White modal. */
  color: #000000; /* Black text. */
  border: 2px solid #000000; /* Black border. */
  border-radius: 20px; /* Rounded corners. */
  padding: 1.5rem; /* Internal spacing. */
  width: min(720px, 90vw); /* Responsive width. */
  max-height: 80vh; /* Limit height. */
  display: flex; /* Stack content. */
  flex-direction: column; /* Vertical layout. */
  gap: 1rem; /* Space between elements. */
}

.terms-close {
  align-self: flex-end; /* Place close button to right. */
  background: transparent; /* No background. */
  border: none; /* No border. */
  font-size: 1.5rem; /* Larger icon. */
  color: #000000; /* Black icon. */
  cursor: pointer; /* Pointer cursor. */
}

.terms-scroll {
  border: 1px solid #000000; /* Black border. */
  padding: 1rem; /* Internal padding. */
  overflow-y: auto; /* Scroll content. */
  max-height: 45vh; /* Scrollable height. */
}

.terms-actions {
  display: flex; /* Align buttons. */
  justify-content: flex-end; /* Right align. */
  gap: 0.75rem; /* Space between buttons. */
}

.terms-accept {
  background: var(--brand-blue); /* Blue accept button. */
  color: #ffffff; /* White text. */
  border: 2px solid var(--brand-blue); /* Blue border. */
}

.terms-decline {
  background: #000000; /* Black decline button. */
  color: #ffffff; /* White text. */
  border: 2px solid #000000; /* Black border. */
}


/* Alert palette overrides */
.alert-info,
.alert-success,
.alert-danger,
.alert-warning {
  background: #ffffff; /* White background. */
  color: #000000; /* Black text. */
  border: 1px solid var(--brand-blue); /* Blue border. */
}


/* Login success page */
.welcome-copy {
  color: rgba(0, 0, 0, 0.7); /* Muted black copy. */
  line-height: 1.6; /* Readable line height. */
}

.welcome-rental-prompt {
  display: grid;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(0, 75, 135, 0.12);
  background: linear-gradient(135deg, rgba(31, 102, 191, 0.08), rgba(31, 102, 191, 0.02));
}

.welcome-rental-label {
  margin: 0;
  color: #12335c;
  font-weight: 600;
  line-height: 1.55;
}

.welcome-rental-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 52px;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  border: 1px solid #1f66bf;
  background: linear-gradient(135deg, #1f66bf 0%, #0f4f9f 100%);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(31, 102, 191, 0.12),
    0 16px 34px rgba(16, 72, 136, 0.24);
}

.welcome-rental-btn:hover,
.welcome-rental-btn:focus {
  color: #ffffff;
  background: linear-gradient(135deg, #1a5cae 0%, #0d478a 100%);
}

.welcome-rental-btn:active,
.welcome-rental-btn.is-touch-active {
  color: #ffffff;
  background: linear-gradient(135deg, #1a5cae 0%, #0d478a 100%);
}

.welcome-actions {
  display: flex; /* Horizontal actions. */
  flex-wrap: wrap; /* Wrap on small screens. */
  gap: 0.75rem; /* Spacing between buttons. */
}

.welcome-actions .btn {
  border-radius: 14px; /* Match input radius. */
  padding: 0.8rem 1.1rem; /* Comfortable button padding. */
}

/* Profile page summary block */
.profile-summary {
  background: #f6f6f6;
  border: 1px solid #000000;
  border-radius: 16px;
  padding: 1rem 1.2rem;
}

.profile-summary p {
  margin: 0 0 0.4rem;
}

/* Phone input selector */
.phone-group {
  display: grid;
  gap: 0.55rem;
}

.phone-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 0.6rem;
  align-items: start;
}

.phone-search-wrap {
  position: relative;
}

.phone-suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.2rem);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: none;
}

.phone-suggestion-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.35;
}

.phone-suggestion-item:hover,
.phone-suggestion-item.is-active {
  background: rgba(0, 75, 135, 0.08);
}

.phone-field-hint {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: rgba(0, 0, 0, 0.55);
}

.phone-error {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: #b00020;
  display: none;
}

@media (max-width: 640px) {
  .phone-grid {
    grid-template-columns: 1fr;
  }

  .welcome-rental-btn {
    width: 100%;
  }
}
