/* =============================================================
   Approvallo — Custom Auth Forms
   No Dashtrap/Tailwind dependencies. Standalone CSS.
   ============================================================= */

/* ─── Preline utility (no Tailwind on this layout) ───────── */
/* Preline JS adds/removes .hidden to show/hide dropdowns     */
.hidden { display: none !important; }

/* ─── Page Shell ──────────────────────────────────────────── */

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 1.5rem;
}

/* ─── Language Switcher (auth page) ──────────────────────── */

body.login-page .auth-lang {
  position: fixed;
  top: 1.1rem;
  inset-inline-end: 1.25rem;
  z-index: 200;
}

/* Trigger pill */
body.login-page .auth-lang .hs-dropdown > button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.875rem 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

body.login-page .auth-lang .hs-dropdown > button:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

/* Tiny chevron after the locale code */
body.login-page .auth-lang .hs-dropdown > button::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4.5px solid rgba(255, 255, 255, 0.75);
  margin-left: 0.1rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

body.login-page .auth-lang .hs-dropdown.open > button::after,
body.login-page .auth-lang .hs-dropdown-menu:not(.hidden) ~ button::after {
  transform: rotate(180deg);
}

/* Flag size inside trigger */
body.login-page .auth-lang .hs-dropdown > button .locale-flag {
  width: 18px !important;
  height: 14px !important;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Dropdown panel */
body.login-page .auth-lang .hs-dropdown-menu {
  background: rgba(18, 6, 44, 0.88) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.06) inset !important;
  padding: 0.4rem !important;
  min-width: 168px !important;
  margin-top: 0.5rem !important;
}

/* Dropdown option buttons */
body.login-page .auth-lang .hs-dropdown-menu form button {
  display: flex !important;
  align-items: center !important;
  gap: 0.625rem !important;
  width: 100% !important;
  text-align: left !important;
  padding: 0.55rem 0.75rem !important;
  border-radius: 8px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.78) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  font-family: inherit !important;
}

body.login-page .auth-lang .hs-dropdown-menu form button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

/* Active / current language */
body.login-page .auth-lang .hs-dropdown-menu form button.font-medium {
  background: rgba(124, 58, 237, 0.38) !important;
  color: #fff !important;
  font-weight: 600 !important;
}

body.login-page .auth-lang .hs-dropdown-menu form button.font-medium:hover {
  background: rgba(124, 58, 237, 0.52) !important;
}

/* Flag size inside dropdown */
body.login-page .auth-lang .hs-dropdown-menu .locale-flag {
  width: 20px !important;
  height: 15px !important;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
}

/* ─── Card ────────────────────────────────────────────────── */

.auth-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 20px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.55) inset,
    0 -1px 0 rgba(0, 0, 0, 0.04) inset,
    0 32px 80px rgba(46, 16, 101, 0.4),
    0 8px 24px rgba(46, 16, 101, 0.18);
  overflow: hidden;
  position: relative;
}

/* subtle top accent bar */
.auth-card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #7c3aed 0%, #c026d3 55%, #f472b6 100%);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

/* ─── Header ──────────────────────────────────────────────── */

.auth-card__header {
  padding: 2.25rem 2.5rem 0;
  text-align: center;
}

.auth-logo-img {
  max-height: 64px;
  width: auto;
  object-fit: contain;
  margin: 0 auto 1.1rem;
  display: block;
}

.auth-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 1.1rem;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.auth-card__title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #1e1b4b;
  letter-spacing: -0.025em;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

/* ─── Body ────────────────────────────────────────────────── */

.auth-card__body {
  padding: 1.75rem 2.5rem 2.25rem;
}

/* ─── Alerts ──────────────────────────────────────────────── */

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.875rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.auth-alert--success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

.auth-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.auth-alert i {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ─── Hint text ───────────────────────────────────────────── */

.auth-hint {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* ─── Form ────────────────────────────────────────────────── */

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-field {
  margin-bottom: 1.125rem;
}

.auth-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

/* ── Input wrapper (icon support) ─── */
.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 1.05rem;
  pointer-events: none;
  transition: color 0.15s ease;
}

.auth-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #111827;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  outline: none;
  box-sizing: border-box;
  line-height: 1.5;
}

.auth-input--no-icon {
  padding-left: 1rem;
}

.auth-input::placeholder {
  color: #b0b9c6;
}

.auth-input:focus {
  border-color: #7c3aed;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.13);
}

.auth-input:focus + .auth-input-icon,
.auth-input-wrap:focus-within .auth-input-icon {
  color: #7c3aed;
}

.auth-input.is-invalid {
  border-color: #ef4444;
  background: #fef2f2;
}

.auth-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.13);
}

.auth-field-error {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: #dc2626;
  margin-top: 0.4rem;
}

/* ─── Row (remember me + forgot link) ────────────────────── */

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: #4b5563;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  accent-color: #7c3aed;
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── Submit Button ───────────────────────────────────────── */

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #c026d3 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.38);
  margin-bottom: 0.1rem;
}

.auth-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.45);
}

.auth-btn:active {
  transform: translateY(0);
  opacity: 1;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.auth-btn i {
  font-size: 1rem;
}

/* ─── Footer links ────────────────────────────────────────── */

.auth-footer {
  text-align: center;
  margin-top: 1.1rem;
}

.auth-link {
  font-size: 0.875rem;
  color: #7c3aed;
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  color: #6d28d9;
  text-decoration: underline;
}

.auth-link-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.auth-link-back:hover {
  color: #7c3aed;
  text-decoration: none;
}

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 500px) {
  .auth-card {
    border-radius: 14px;
  }

  .auth-card__header {
    padding: 2rem 1.5rem 0;
  }

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

  .auth-card__title {
    font-size: 1.35rem;
  }

  body.login-page {
    padding: 1rem;
  }
}
