/*
 * ============================================================
 * Colégio Santa Teresa — Design System
 * Estética: Editorial quente / Caderno escolar refinado
 * ============================================================
 */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  /* Papel */
  --paper:        #FAF7F2;
  --paper-warm:   #F5F0E8;
  --paper-cream:  #F0EBE1;
  --paper-line:   #E8E2D6;

  /* Texto */
  --ink:          #2C2418;
  --ink-soft:     #5C4F3D;
  --ink-faint:    #9B8E7C;
  --ink-muted:    #B8AD9C;

  /* Acentos */
  --green-lousa:  #2D4A3E;
  --green-soft:   #3A5F4F;
  --green-light:  #E8F0EB;
  --green-pale:   #F2F7F4;

  --terracotta:   #C75B3A;
  --terracotta-s: #D4744F;
  --terracotta-l: #F5E6DE;

  --gold:         #C4973B;
  --gold-s:       #D4A94E;
  --gold-l:       #FAF0D7;

  --blue-tinta:   #3B5998;
  --blue-soft:    #4A6FA5;
  --blue-light:   #E4EAF3;
  --blue-pale:    #F0F3F8;

  --rose:         #A84448;
  --rose-s:       #C25558;
  --rose-l:       #F5E2E2;

  --amber:        #B8860B;
  --amber-s:      #D4A017;
  --amber-l:      #FDF3D7;

  /* Sombras */
  --shadow-sm:    0 1px 2px rgba(44,36,24,0.04), 0 1px 1px rgba(44,36,24,0.06);
  --shadow-md:    0 4px 8px rgba(44,36,24,0.06), 0 2px 4px rgba(44,36,24,0.04);
  --shadow-lg:    0 12px 24px rgba(44,36,24,0.08), 0 4px 8px rgba(44,36,24,0.04);
  --shadow-paper: 0 1px 3px rgba(44,36,24,0.08), 0 4px 12px rgba(44,36,24,0.04);

  /* Bordas */
  --radius-sm:    3px;
  --radius-md:    6px;
  --radius-lg:    10px;

  /* Tipografia */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Base Reset ──────────────────────────────────────────── */
html {
  background-color: var(--paper);
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Paper Texture Background ────────────────────────────── */
.paper-bg {
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ── Notebook Lines Background ───────────────────────────── */
.notebook-lines {
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 31px,
      var(--paper-line) 31px,
      var(--paper-line) 32px
    );
  background-position: 0 16px;
}

/* ── Card Base ───────────────────────────────────────────── */
.card-paper {
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-paper);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.card-paper:hover {
  box-shadow: var(--shadow-md);
}

/* ── Card Header with Margin Accent ──────────────────────── */
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--paper-line);
  position: relative;
}

.card-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.card-header--green::before  { background: var(--green-lousa); }
.card-header--terra::before  { background: var(--terracotta); }
.card-header--gold::before   { background: var(--gold); }
.card-header--blue::before   { background: var(--blue-tinta); }
.card-header--rose::before   { background: var(--rose); }
.card-header--amber::before  { background: var(--amber); }
.card-header--ink::before    { background: var(--ink-soft); }

/* ── Typography ──────────────────────────────────────────── */
.font-display {
  font-family: var(--font-display);
}

.font-body {
  font-family: var(--font-body);
}

/* ── Field Label ─────────────────────────────────────────── */
.field-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin-bottom: 0.3125rem;
}

label.field-label {
  display: block;
}

/* ── Section Title ───────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-top: 0.125rem;
}

/* ── Sidebar Card ────────────────────────────────────────── */
.sidebar-card {
  background: var(--paper);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.sidebar-card:hover {
  box-shadow: var(--shadow-md);
}

.sidebar-card__header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--paper-line);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8125rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn--primary {
  background: var(--green-lousa);
  color: #fff;
  box-shadow: 0 1px 2px rgba(45,74,62,0.15);
}

.btn--primary:hover {
  background: var(--green-soft);
  box-shadow: 0 2px 6px rgba(45,74,62,0.2);
  transform: translateY(-1px);
}

.btn--accent {
  background: var(--terracotta);
  color: #fff;
  box-shadow: 0 1px 2px rgba(199,91,58,0.15);
}

.btn--accent:hover {
  background: var(--terracotta-s);
  box-shadow: 0 2px 6px rgba(199,91,58,0.2);
  transform: translateY(-1px);
}

.btn--gold {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 1px 2px rgba(196,151,59,0.15);
}

.btn--gold:hover {
  background: var(--gold-s);
  box-shadow: 0 2px 6px rgba(196,151,59,0.2);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--paper-line);
}

.btn--outline:hover {
  background: var(--paper-warm);
  border-color: var(--ink-muted);
}

.btn--danger-outline {
  background: transparent;
  color: var(--rose);
  border: 1px solid var(--rose-l);
}

.btn--danger-outline:hover {
  background: var(--rose-l);
}

.btn--full {
  width: 100%;
  padding: 0.625rem 1rem;
}

.btn--sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
}

.btn--md {
  padding: 0.5rem 1rem;
}

/* ── Inputs ──────────────────────────────────────────────── */
.input-paper {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
  width: 100%;
}

.input-paper:focus {
  outline: none;
  border-color: var(--green-lousa);
  box-shadow: 0 0 0 2px rgba(45,74,62,0.1);
  background: #fff;
}

.input-paper::placeholder {
  color: var(--ink-muted);
}

textarea.input-paper {
  resize: vertical;
  min-height: 5rem;
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1875rem 0.625rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--green  { background: var(--green-light); color: var(--green-lousa); }
.badge--terra  { background: var(--terracotta-l); color: var(--terracotta); }
.badge--gold   { background: var(--gold-l); color: var(--amber); }
.badge--blue   { background: var(--blue-light); color: var(--blue-tinta); }
.badge--rose   { background: var(--rose-l); color: var(--rose); }
.badge--amber  { background: var(--amber-l); color: var(--amber); }
.badge--ink    { background: var(--paper-warm); color: var(--ink-soft); }
.badge--neutral { background: var(--paper-warm); color: var(--ink-soft); }

.badge--required {
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  background: var(--rose-l);
  color: var(--rose);
  padding: 0.125rem 0.5rem;
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--paper-cream);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-bar__fill--green {
  background: linear-gradient(90deg, var(--green-lousa), var(--green-soft));
}

.progress-bar__fill--gold {
  background: linear-gradient(90deg, var(--gold), var(--gold-s));
}

/* ── Alert Boxes ─────────────────────────────────────────── */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.alert--error {
  background: var(--rose-l);
  border: 1px solid rgba(168,68,68,0.2);
  color: var(--rose);
}

.alert--warning {
  background: var(--amber-l);
  border: 1px solid rgba(184,134,11,0.2);
  color: var(--amber);
}

.alert--info {
  background: var(--blue-pale);
  border: 1px solid rgba(59,89,152,0.15);
  color: var(--blue-tinta);
}

/* ── Status Dots ─────────────────────────────────────────── */
.status-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
}

.status-dot--approved {
  background: var(--green-light);
  color: var(--green-lousa);
}

.status-dot--pending {
  background: var(--rose-l);
  color: var(--rose);
}

.status-dot--review {
  background: var(--amber-l);
  color: var(--amber);
}

.status-dot--na {
  background: var(--paper-warm);
  color: var(--ink-muted);
}

/* ── Avatar Circle ───────────────────────────────────────── */
.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green-lousa);
  flex-shrink: 0;
}

.avatar-circle--sm {
  width: 1.5rem;
  height: 1.5rem;
}

.avatar-circle--terra {
  background: var(--terracotta-l);
  color: var(--terracotta);
}

.avatar-circle--blue {
  background: var(--blue-light);
  color: var(--blue-tinta);
}

.avatar-circle--gold {
  background: var(--gold-l);
  color: var(--gold);
}

/* ── Divider ─────────────────────────────────────────────── */
.divider {
  border: none;
  height: 1px;
  background: var(--paper-line);
  margin: 1.5rem 0;
}

.divider--thick {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--paper-line), transparent);
}

/* ── Anchor / Tab Bar ────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--paper-line);
  overflow-x: auto;
}

.tab-bar__item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-faint);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-body);
}

.tab-bar__item:hover {
  color: var(--green-lousa);
  border-bottom-color: var(--green-lousa);
}

.tab-bar__item--active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.tab-bar__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--rose);
  flex-shrink: 0;
}

/* ── Checklist ───────────────────────────────────────────── */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
  cursor: pointer;
  font-size: 0.8125rem;
}

.checklist-item:hover {
  background: var(--paper-warm);
}

.checklist-item--pending {
  color: var(--ink);
  font-weight: 500;
}

.checklist-item--done {
  color: var(--ink-faint);
}

.checklist-item__icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checklist-item__icon--done {
  background: var(--green-light);
  color: var(--green-lousa);
}

.checklist-item__icon--pending {
  background: var(--rose-l);
  color: var(--rose);
}

/* ── Highlight Marker ────────────────────────────────────── */
.highlight-marker {
  position: relative;
  display: inline;
}

.highlight-marker::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 0;
  height: 40%;
  background: rgba(196,151,59,0.2);
  border-radius: 2px;
  z-index: -1;
}

/* ── Staggered Animation ─────────────────────────────────── */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-in--1 { animation-delay: 0.05s; }
.animate-in--2 { animation-delay: 0.1s; }
.animate-in--3 { animation-delay: 0.15s; }
.animate-in--4 { animation-delay: 0.2s; }
.animate-in--5 { animation-delay: 0.25s; }
.animate-in--6 { animation-delay: 0.3s; }

/* ── Paper Stack (Sidebar Overlap) ───────────────────────── */
.paper-stack {
  position: relative;
}

.paper-stack > * + * {
  margin-top: 0.75rem;
}

.paper-stack::before {
  content: '';
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  right: -0.25rem;
  bottom: -0.25rem;
  background: var(--paper-cream);
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-md);
  z-index: -1;
  opacity: 0.5;
}

/* ── Timeline ────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 1.25rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.3125rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--paper-line);
}

.timeline__item {
  position: relative;
  padding-bottom: 0.875rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -1.25rem;
  top: 0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--green-lousa);
  border: 2px solid var(--paper);
}

.timeline__text {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.timeline__time {
  font-size: 0.6875rem;
  color: var(--ink-muted);
  margin-top: 0.125rem;
}

/* ── Document Row ────────────────────────────────────────── */
.doc-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--paper-line);
  transition: background 0.15s ease;
}

.doc-row:last-child {
  border-bottom: none;
}

.doc-row:hover {
  background: var(--paper-warm);
}

/* ── Guardian / Contact Card ─────────────────────────────── */
.person-card {
  padding: 1rem;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius-md);
  background: var(--paper);
  transition: box-shadow 0.2s ease;
}

.person-card:hover {
  box-shadow: var(--shadow-sm);
}

/* ── Link Styles ─────────────────────────────────────────── */
.link-action {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--green-lousa);
  text-decoration: none;
  transition: color 0.15s ease;
}

.link-action:hover {
  color: var(--green-soft);
}

.link-action--terra {
  color: var(--terracotta);
}

.link-action--terra:hover {
  color: var(--terracotta-s);
}

/* ── Field Label ─────────────────────────────────────────── */
.field-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}

/* ── Next Step Banner ────────────────────────────────────── */
.next-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--gold-l);
  border: 1px solid rgba(196,151,59,0.2);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--amber);
}

/* ── Details / Accordion ─────────────────────────────────── */
.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
  transition: color 0.15s ease, background 0.15s ease;
  user-select: none;
}

.accordion summary::-webkit-details-marker { display: none; }

.accordion summary:hover {
  color: var(--ink);
  background: var(--paper-warm);
}

.accordion summary::after {
  content: '';
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--ink-muted);
  border-bottom: 1.5px solid var(--ink-muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.accordion[open] summary::after {
  transform: rotate(-135deg);
}

.accordion__content {
  padding: 0.5rem 1.5rem 1.25rem;
}

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE — Split-screen professional layout
   ══════════════════════════════════════════════════════════ */

.login-split {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* ── Left brand panel ────────────────────────────────────── */
.login-brand {
  flex: 0 0 44%;
  position: relative;
  overflow: hidden;
  background: var(--green-lousa);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  border-right: 3px solid var(--terracotta);
  animation: loginBrandIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Paper noise */
.login-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* Notebook lines */
.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 39px,
    rgba(255,255,255,0.045) 39px,
    rgba(255,255,255,0.045) 40px
  );
  pointer-events: none;
}

.login-brand__content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.login-brand__emblem {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2.25rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.login-brand__emblem:hover {
  transform: scale(1.04);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.06);
}

.login-brand__pre {
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 0.25rem;
}

.login-brand__name {
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--paper);
  margin: 0;
}

.login-brand__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.625rem auto;
  max-width: 180px;
  color: rgba(255,255,255,0.18);
}

.login-brand__divider::before,
.login-brand__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
}

.login-brand__diamond {
  font-size: 0.4375rem;
  color: var(--terracotta-s);
  line-height: 1;
}

.login-brand__tagline {
  font-family: var(--font-body);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

/* Watermark icon bottom-right */
.login-brand__watermark {
  position: absolute;
  bottom: -4rem;
  right: -4rem;
  width: 20rem;
  height: 20rem;
  color: rgba(255,255,255,0.03);
  pointer-events: none;
  stroke-width: 0.4;
}

/* ── Right form panel ────────────────────────────────────── */
.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  background: var(--paper);
  animation: loginFormIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.login-form-inner {
  width: 100%;
  max-width: 368px;
}

/* Welcome heading */
.login-form-welcome {
  margin-bottom: 2rem;
}

.login-form-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 0.375rem;
}

.login-form-subtitle {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink-faint);
  margin: 0;
}

/* Floating-label field wrapper */
.login-field {
  position: relative;
  margin-bottom: 1.125rem;
}

.login-input {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1.5px solid var(--paper-line);
  border-radius: var(--radius-md);
  padding: 1.3125rem 0.875rem 0.4375rem;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
}

.login-input:focus {
  outline: none;
  border-color: var(--green-lousa);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45,74,62,0.08);
}

/* Label floats up on focus or when filled */
.login-label {
  position: absolute;
  top: 0.9375rem;
  left: 0.875rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ink-faint);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  transform-origin: left top;
  will-change: transform;
}

.login-input:focus + .login-label,
.login-input:not(:placeholder-shown) + .login-label {
  transform: translateY(-0.4rem) scale(0.72);
  color: var(--green-lousa);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Submit button with arrow */
.login-submit-wrap {
  margin-top: 1.75rem;
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9375rem 1.5rem;
  background: var(--green-lousa);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(45,74,62,0.22), 0 1px 2px rgba(45,74,62,0.14);
}

.login-btn:hover {
  background: var(--green-soft);
  box-shadow: 0 6px 20px rgba(45,74,62,0.3), 0 2px 6px rgba(45,74,62,0.18);
  transform: translateY(-1px);
}

.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(45,74,62,0.18);
}

.login-btn__arrow {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.login-btn:hover .login-btn__arrow {
  transform: translateX(4px);
}

/* Remember me */
.login-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.login-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--green-lousa);
  cursor: pointer;
  flex-shrink: 0;
}

.login-remember label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

/* Links row below form */
.login-meta {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

.login-meta a {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.15s ease;
  position: relative;
}

.login-meta a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--green-lousa);
  transition: width 0.25s ease;
}

.login-meta a:hover {
  color: var(--green-lousa);
}

.login-meta a:hover::after {
  width: 100%;
}

/* Page footer inside form panel */
.login-footer {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

/* Animations */
@keyframes loginBrandIn {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes loginFormIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Mobile */
@media (max-width: 768px) {
  .login-split { flex-direction: column; }

  .login-brand {
    flex: none;
    border-right: none;
    border-bottom: 3px solid var(--terracotta);
    padding: 2.25rem 1.5rem;
  }

  .login-brand__name { font-size: 2.375rem; }
  .login-brand__watermark { display: none; }

  .login-form-panel { padding: 2rem 1.25rem; }

  .login-form-title { font-size: 1.625rem; }

  .login-footer { position: static; margin-top: 2rem; }
}

/* ── Dialog / Modal ─────────────────────────────────────── */
dialog {
  margin: auto;
}

dialog::backdrop {
  background: rgba(44, 36, 24, 0.45);
  backdrop-filter: blur(2px);
}
