/* Tokens just for login (independent of main base.html) */
:root {
  --bg: #f7f9fc;
  --bg-shell: #eef2ff;
  --panel: #ffffff;
  --ink: #0b1220;
  --muted: #6b7280;
  --border-subtle: rgba(148, 163, 184, 0.4);

  --brand: #10b981;
  --brand-600: #059669;

  --radius-lg: 24px;
  --radius-md: 12px;
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.3);

  --error-bg: rgba(239, 68, 68, 0.08);
  --error-border: rgba(248, 113, 113, 0.7);
  --error-ink: #b91c1c;
}

:root.dark {
  --bg: #020617;
  --bg-shell: #020617;
  --panel: rgba(15, 23, 42, 0.98);
  --ink: #f9fafb;
  --muted: #9ca3af;
  --border-subtle: rgba(148, 163, 184, 0.3);

  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.85);

  --error-bg: rgba(239, 68, 68, 0.14);
  --error-border: rgba(248, 113, 113, 0.7);
  --error-ink: #fee2e2;
}

/* Base layout */

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(140% 200% at 0% 0%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(140% 200% at 100% 0%, rgba(16, 185, 129, 0.16), transparent 60%),
    var(--bg);
  color: var(--ink);
}

main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

/* Utilities */

.visually-hidden {
  position: absolute;
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
}

/* Page shell */

.login-page {
  width: 100%;
  max-width: 1080px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.5rem;
  padding: 2.5rem;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.96));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
}

:root.dark .login-shell {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99));
}

/* Hero side */

.login-hero {
  position: relative;
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  justify-content: center;
}

.login-hero::after {
  content: "";
  position: absolute;
  right: -1.25rem;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(148, 163, 184, 0.35),
    transparent
  );
}

/* Top Pestana logo – centered, dark in light mode, white in dark mode */
.login-logo {
  width: 150px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 0.4rem;  /* center horizontally above slider */
  filter: invert(1);      /* light mode: turn white asset into dark logo */
}

:root.dark .login-logo {
  filter: invert(0);      /* dark mode: keep original white logo */
}


/* Hero slider with dynamic height */

.hero-slider {
  position: relative;
  width: 100%;
  max-width: 460px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #020617;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.6);
  margin-bottom: 0.9rem;
}

/* Maintain aspect ratio so height is stable while slides fade */
.hero-slider::before {
  content: "";
  display: block;
  padding-top: 62%; /* ~16:10, adjust if you want taller/shorter */
}

/* Slides stacked, fade via opacity */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease-in-out;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* Slider dots */

.hero-slider-dots {
  position: absolute;
  left: 50%;
  bottom: 0.6rem;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 0.4rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(148, 163, 184, 0.7);
}

.hero-dot.is-active {
  width: 18px;
  background: #10b981;
}

/* Hero text block – tightened to look like the screenshot */

.login-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

.login-hero-title {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0.25rem 0 0;
  font-weight: 700;
  background: linear-gradient(90deg, #0b1120, #10b981 35%, #0369a1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap; /* keep full phrase on one line */
}

:root.dark .login-hero-title {
  background: linear-gradient(90deg, #e5e7eb, #a7f3d0 35%, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


.login-hero-copy {
  margin: 0.4rem 0 0;
  font-size: 0.98rem;
  color: var(--muted);
  max-width: 32rem;
}

.login-highlights {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.login-highlights li {
  color: var(--ink);
}

.login-highlights li::before {
  content: "•";
  margin-right: 0.4rem;
  color: var(--brand);
}

/* Card side */

/* Sign-in card */
.login-container {
  border-radius: 22px;
  padding: 1.75rem 1.75rem 0;  /* NO bottom padding */
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);

  display: flex;
  flex-direction: column;
  min-height: 620px;           /* taller card -> footer can sit lower */
}



/* Header */

.login-header {
  margin-bottom: 1.4rem;
}

.login-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.login-title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--ink);
}

.login-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Theme toggle (driven by base.js via #themeToggle) */

.theme-toggle {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(249, 250, 251, 0.95);
  width: 42px;
  height: 24px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  font-size: 0.7rem;
  cursor: pointer;
}

:root.dark .theme-toggle {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
}

.theme-toggle-icon {
  flex: 1;
  text-align: center;
  opacity: 0.4;
}

/* visual emphasis based on theme */

:root:not(.dark) .theme-toggle-icon-sun {
  opacity: 1;
}

:root.dark .theme-toggle-icon-moon {
  opacity: 1;
}

/* Form */

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.9rem;
  color: var(--ink);
}

.form-group input {
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f9fafb;
  color: #111827;
  font-size: 0.95rem;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

:root.dark .form-group input {
  background: rgba(15, 23, 42, 0.75);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.6);
}

.form-group input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.45);
  background: #ffffff;
}

:root.dark .form-group input:focus {
  background: rgba(15, 23, 42, 0.95);
}

.helper-note {
  font-size: 0.83rem;
  color: var(--muted);
}

/* Inline row */

.form-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
  font-size: 0.88rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}

.checkbox input {
  width: 15px;
  height: 15px;
  border-radius: 4px;
}

/* Buttons */

button {
  font-family: inherit;
}

.btn-primary,
.btn-secondary,
.btn-tertiary,
.link-button {
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.7rem 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--brand), var(--brand-600));
  color: #f9fafb;
  transition:
    transform 0.06s ease,
    box-shadow 0.1s ease,
    filter 0.1s ease;
}

.btn-primary:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(16, 185, 129, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(16, 185, 129, 0.4);
}

.btn-primary[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.btn-secondary {
  flex: 1;
  background: #f9fafb;
  border-color: rgba(148, 163, 184, 0.8);
  color: #111827;
}

.btn-secondary:hover {
  background: #ffffff;
}

:root.dark .btn-secondary {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
}

.btn-tertiary {
  flex: 1;
  background: transparent;
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--muted);
}

.btn-tertiary:hover {
  background: rgba(249, 250, 251, 0.8);
}

:root.dark .btn-tertiary {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
}

.link-button {
  background: none;
  border: none;
  color: var(--brand-600);
  padding-inline: 0;
}

.link-button:hover {
  text-decoration: underline;
}

/* Actions layout */

.primary-actions {
  margin-top: 0.25rem;
}

.secondary-actions {
  margin-top: 0.7rem;
  display: flex;
  gap: 0.75rem;
}

.secondary-actions-inline {
  justify-content: flex-start;
}

/* Feedback */

.error {
  margin-bottom: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-ink);
  font-size: 0.9rem;
}

/* Footer */

/* Footer inside card */
.login-footer {
  margin-top: auto;        /* pushes footer to bottom of card */
  padding-top: 0.75rem;    /* small gap above logos */
  padding-bottom: 0;       /* no extra space below */
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  align-items: center;
}




/* Right-card logos: centered, subtle background, visible on both themes */
.footer-logos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.35);
  margin: 0;               /* important: no extra margin */
}


:root.dark .footer-logos {
  background: rgba(15, 23, 42, 0.97);
  border-color: rgba(148, 163, 184, 0.5);
}

.footer-logo {
  height: 26px;
  max-width: 120px;
  width: auto;
  display: block;
}

:root.dark .footer-logo {
  filter: brightness(1.08);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

/* Footer */

.login-footer {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--muted);
  align-items: center;
}

/* Logos row – always on a light pill so colours & text stay readable */
.footer-logos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: #f9fafb; /* light background in both themes */
  border: 1px solid rgba(148, 163, 184, 0.35);
}

:root.dark .footer-logos {
  background: #f9fafb; /* keep logos on light pill even in dark mode */
  border-color: rgba(148, 163, 184, 0.6);
}

/* Logo images – no filters so original colours & text are preserved */
.footer-logo {
  height: 26px;
  max-width: 120px;
  width: auto;
  display: block;
}

/* explicitly avoid any filter in dark mode */
:root.dark .footer-logo {
  filter: none;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}


.offline {
  display: none;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  background: rgba(249, 250, 251, 0.9);
  color: #111827;
}

/* If you add body.offline via JS, message will show */
body.offline .offline {
  display: inline-flex;
}

:root.dark .offline {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
}

.noscript-note {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(250, 204, 21, 0.7);
  background: rgba(252, 211, 77, 0.16);
  color: #78350f;
}

:root.dark .noscript-note {
  color: #fef9c3;
}

/* Responsive */

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 2rem 1.5rem;
  }

  .login-hero {
    padding-right: 0;
  }

  .login-hero::after {
    display: none;
  }

  .login-logo {
    width: 140px;
  }
}

@media (max-width: 640px) {
  main {
    padding: 1.8rem 1rem;
  }

  .login-shell {
    padding: 1.6rem 1.25rem;
    border-radius: 20px;
  }

  .login-hero-title {
    font-size: 1.6rem;
  }

  .login-header-top {
    align-items: center;
  }

  .secondary-actions {
    flex-direction: column;
  }

   .login-hero-title {
    font-size: 1.6rem;
    white-space: normal; 
  }
}
