:root{
  --bg:#f6faf7;
  --card:#ffffff;
  --stroke:#e6efe8;
  --text:#0f1a12;
  --muted:#5e6e63;
  --accent:#2f8d2a;
  --accent-2:#1f6a1b;
  --accent-soft:#e9f6ea;
  --ok:#26a269;
  --shadow: 0 12px 28px rgba(18, 61, 28, .08);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background:
    radial-gradient(60rem 50rem at 85% -10%, #ecf8ee 0%, transparent 60%),
    radial-gradient(70rem 60rem at -10% 100%, #f0fbf2 0%, transparent 55%),
    var(--bg);
}

.page{ min-height:100%; display:grid; place-items:center; padding:24px; }
.login-wrap{ width:100%; max-width: 520px; }

.card{
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius: 18px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(.98);
  opacity: 0;
  animation: enter .5s cubic-bezier(.2,.8,.2,1) .05s forwards;
}
.hidden{ display:none !important; }

@keyframes enter{ to{ transform: translateY(0) scale(1); opacity:1; } }

/* transitions */
.fade-out{ animation: fadeOut .35s ease forwards; }
@keyframes fadeOut{ to{ opacity:0; transform: translateY(8px) scale(.98); } }
.fade-in{ animation: fadeIn .35s ease .1s forwards; opacity:0; transform: translateY(8px) scale(.98); }
@keyframes fadeIn{ to{ opacity:1; transform: translateY(0) scale(1); } }

.avatar {
  width: 88px; 
  height: 88px; 
  border-radius: 999px; 
  display: grid; 
  place-items: center;
  margin: -40px auto 4px; /* Reduzido de -64px para -48px */
  border: 6px solid #ffffff;
  background: radial-gradient(60% 60% at 50% 30%, #49b34f 0%, #2f8d2a 60%, #1f6a1b 100%);
  box-shadow: 0 10px 22px rgba(47,141,42,.25), 0 0 0 8px var(--accent-soft);
}
.avatar svg{ pointer-events:none }

.brand { 
  text-align: center; 
  margin: 8px 0 2px; 
  font-size: 28px; 
  font-weight: 800; 
}
.subtitle {
  text-align: center;
  margin: 0 0 24px; /* Aumentado de 12px/16px para 24px */
  color: var(--muted);
  font-size: 14px;
}
.field{ margin-bottom:14px }
.field label{
  margin-bottom:4px;
}
.input{
  display:flex; align-items:center; gap:8px; background:#f7fbf8;
  border:1px solid var(--stroke); border-radius: 12px; padding: 10px 12px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .08s ease, background .2s ease;
}
.input:focus-within{ border-color: var(--accent); box-shadow:0 0 0 4px rgba(47,141,42,.12); transform: translateY(-1px); background:#fff; }
.input i{ font-size:18px; color:#6f8a75; }
.input input{ flex:1; background:transparent; border:0; outline:0; color:var(--text); font-size:15px; }
.input input::placeholder{ color:#93a69a }

.muted{ color: var(--muted); font-size: 12px; }
.error{ display:block; min-height:16px; color:#d83a3a; font-size:12px; margin-top:6px; }

/* Buttons */
.btn{
  margin-top:6px; width:100%; display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-weight:800; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color:#fff; border:0; border-radius:12px; padding:12px 14px; cursor:pointer;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 18px rgba(47,141,42,.24);
}
.btn:hover{ filter:brightness(1.03) }
.btn:active{ transform: translateY(1px) }
.btn:disabled{ opacity:.7; cursor:not-allowed; }
.btn.ghost{ background:#fff; color:var(--accent-2); border:1px solid var(--stroke); box-shadow:none; }
.btn.ghost:hover{ background:#f7fbf8; }

/* Calendário */
.calendar-card{ padding: 18px 18px 22px; }

.cal-header{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.cal-nav{ display:flex; align-items:center; gap:10px; }
.cal-title{ margin:0; font-size:20px; font-weight:800; letter-spacing:.2px; min-width:10ch; text-align:center; }
.nav-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:10px; border:1px solid var(--stroke);
  background:#f7fbf8; cursor:pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
}
.nav-btn:hover{ background:#fff; border-color:#dfeae1; }
.nav-btn i{ font-size:20px; }

.logout-btn{
  display:inline-flex; align-items:center; gap:8px;
  height:38px; padding:0 12px;
  border-radius:10px; border:1px solid var(--stroke);
  background:#fff; color:var(--accent-2);
  font-weight:800; cursor:pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.logout-btn:hover{ background:#f7fbf8; border-color:#dfeae1; }
.logout-btn:active{ transform: translateY(1px); }

.cal-weekdays{
  display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; margin:6px 0 8px; color:var(--muted); font-size:12px; text-align:center;
}
.cal-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; }
.day{
  appearance:none; border:1px solid var(--stroke); border-radius:10px; background:#fff; min-height:44px;
  font:600 14px/1 Inter, system-ui, sans-serif; color:var(--text);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.day:hover{ box-shadow:0 0 0 4px rgba(47,141,42,.10); border-color:#dfeae1; }
.day:active{ transform: translateY(1px); }
.day.out{ color:#9bb1a2; background:#f7fbf8; }
.day.today{ outline: 2px solid rgba(47,141,42,.35); }
.day.selected{ background:linear-gradient(180deg, var(--accent), var(--accent-2)); color:#fff; border-color:transparent; }

/* Turnos (timeline) */
.turnos{ margin-top:16px; }
.turnos h3{ margin: 6px 0 10px; text-align:center; }

.timeline{
  list-style:none; margin:0 auto; padding:14px 0 4px;
  width:min(400px, 90%); position:relative;
}
.timeline::before{
  content:""; position:absolute; left:30px; top:0; bottom:0; width:6px;
  background: linear-gradient(#bfc8c2, #bfc8c2);
  border-radius: 99px;
}
.step{
  position:relative; display:flex; align-items:center; gap:12px;
  padding: 24px 0 24px 16px;
}
.step .dot{
  position:absolute; left:23px; width:20px; height:20px; border-radius:999px; background:#9aa29d;
  border:3px solid #cfd7d2;
}
.step .label{ margin-left:28px; font-weight:800; }
.step .status{ margin-left:auto; color:var(--muted); font-size:12px; }

/* Botão "Finalizar" estilo pílula */
.pill{
  margin-left:8px;
  border:0; border-radius:999px; padding:8px 14px; font-weight:800;
  background:#2e9d25; color:#fff; cursor:pointer;
  box-shadow:0 6px 14px rgba(46,157,37,.25);
  transition: transform .06s ease, filter .2s ease, opacity .2s ease;
}
.pill:hover{ filter:brightness(1.03); }
.pill:active{ transform: translateY(1px); }
.pill[disabled]{ opacity:.45; cursor:not-allowed; box-shadow:none; }

/* estados visuais */
.step.done .dot{ background:#2e9d25; border-color:#bfe8c0; }
.step.done .status{ color:#2e9d25; font-weight:700; }

/* Overlay de Sucesso (check animado) */
.success-overlay{
  position:fixed; inset:0; display:grid; place-items:center;
  background: radial-gradient(60rem 60rem at 50% 50%, rgba(233,246,234,.65), rgba(233,246,234,.35), rgba(233,246,234,0));
  backdrop-filter: blur(2px);
  opacity:0; pointer-events:none; transition: opacity .25s ease;
}
.success-overlay.show{ opacity:1; pointer-events:auto; }
.check-wrap{ text-align:center; color:var(--accent-2); }
.check-text{ margin-top:10px; font-weight:700; }
.check-svg{ width:min(48vmin, 220px); height:auto; }
.ring{ stroke: currentColor; opacity:.25; stroke-linecap: round; stroke-dasharray: 330; stroke-dashoffset: 330; }
.check{ stroke: currentColor; stroke-dasharray: 120; stroke-dashoffset: 120; }
.success-overlay.play .ring{ animation: ringFill .7s ease-out forwards; }
.success-overlay.play .check{ animation: drawCheck .5s ease-out .45s forwards; }
@keyframes ringFill{ to{ stroke-dashoffset: 0; } }
@keyframes drawCheck{ to{ stroke-dashoffset: 0; } }

/* Rodapé */
.foot{
  text-align:center;
  margin-top: 2vh;
  color: var(--muted);
  font-size: 12px;
}
.foot-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  flex-wrap:wrap;
  margin-bottom:.35rem;
}
.foot .copy{ font-weight:600; color: var(--text); }
.foot .sep{ opacity:.5; }

/* Crédito do desenvolvedor */
.developer-credit {
  opacity: 0.75;
  font-size: 0.8rem;
}
.developer-credit a{
  color: var(--accent-2);      /* combina com o tema verde */
  text-decoration: underline;
}
.developer-credit a:hover{
  filter: brightness(1.1);
  opacity: 1;
}

.turnos-date strong{ color: var(--accent-2); }

:root{
  --bg:#f6faf7;
  --card:#ffffff;
  --stroke:#e6efe8;
  --text:#0f1a12;
  --muted:#5e6e63;
  --accent:#2f8d2a;
  --accent-2:#1f6a1b;
  --accent-soft:#e9f6ea;
  --ok:#26a269;
  --shadow: 0 12px 28px rgba(18, 61, 28, .08);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--text);
  background:
    radial-gradient(60rem 50rem at 85% -10%, #ecf8ee 0%, transparent 60%),
    radial-gradient(70rem 60rem at -10% 100%, #f0fbf2 0%, transparent 55%),
    var(--bg);
}

.page{ min-height:100%; display:grid; place-items:center; padding:24px; }
.login-wrap{ width:100%; max-width: 520px; }

.card{
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius: 18px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(.98);
  opacity: 0;
  animation: enter .5s cubic-bezier(.2,.8,.2,1) .05s forwards;
}
.hidden{ display:none !important; }

@keyframes enter{ to{ transform: translateY(0) scale(1); opacity:1; } }

/* transitions */
.fade-out{ animation: fadeOut .35s ease forwards; }
@keyframes fadeOut{ to{ opacity:0; transform: translateY(8px) scale(.98); } }
.fade-in{ animation: fadeIn .35s ease .1s forwards; opacity:0; transform: translateY(8px) scale(.98); }
@keyframes fadeIn{ to{ opacity:1; transform: translateY(0) scale(1); } }

/* Avatar */
.avatar{
  width: 88px; height: 88px; border-radius: 999px; display:grid; place-items:center;
  margin: -64px auto 8px; border: 6px solid #ffffff;
  background: radial-gradient(60% 60% at 50% 30%, #49b34f 0%, #2f8d2a 60%, #1f6a1b 100%);
  box-shadow: 0 10px 22px rgba(47,141,42,.25), 0 0 0 8px var(--accent-soft);
}
.avatar svg{ pointer-events:none }

.subtitle{ text-align:center; margin: 0 0 12px; color: var(--muted); font-size: 14px; }

.mode-toggle{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  color:var(--muted);
}
.form-toggle{
  position:absolute;
  top:-22px;                     /* encostado no topo do form */
  right:4px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:4px 10px;
  background:rgba(233,246,234,.95);
  border-radius:999px;
  border:1px solid var(--stroke);
  box-shadow:0 6px 14px rgba(18,61,28,.10);
  font-size:13px;
  color:var(--muted);
}
#loginForm{
  position:relative;
  margin-top: 10px;
  padding-top: 32px;             /* abaixa os campos sem mexer no toggle */
}

/* Campo Unidade menor e centralizado */
.field-unidade {
  max-width: 260px;
  margin: 8px auto 14px; /* Reduzido de 20px para 8px */
  text-align: left;
}

.field-unidade .input{
  padding-inline: 10px 14px;
}

/* Select dentro do input */
.field-unidade select{
  flex:1;
  background:transparent;
  border:0;
  outline:0;
  color:var(--text);
  font-size:14px;
  font-family:inherit;
  cursor:pointer;
  appearance:none;
  padding:0;
  height:20px;
  line-height:20px;
}

.field-unidade select:invalid{
  color:#93a69a;                 /* cor de placeholder */
}

.switch{ position:relative; display:inline-block; width:48px; height:26px; }
.switch input{ display:none; }
.slider{
  position:absolute; inset:0; cursor:pointer; border-radius:26px;
  background:#eaf3ec; border:1px solid var(--stroke);
  transition:.2s;
}
.slider:before{
  content:""; position:absolute; left:3px; top:3px; width:20px; height:20px;
  border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.08);
  transition:.2s;
}
.switch input:checked + .slider{
  background:linear-gradient(90deg, var(--accent), var(--accent-2));
  border-color:transparent;
}
.switch input:checked + .slider:before{ transform: translateX(22px); }
.toggle-label{ font-size:13px; color:var(--muted); }

/* Campos */
.field{ margin-bottom:14px }
.field label{ display:block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }

.input{
  display:flex; align-items:center; gap:8px; background:#f7fbf8;
  border:1px solid var(--stroke); border-radius: 12px; padding: 10px 12px;
  transition: border-color .2s ease, box-shadow .2s ease, transform .08s ease, background .2s ease;
}
.input:focus-within{ border-color: var(--accent); box-shadow:0 0 0 4px rgba(47,141,42,.12); transform: translateY(-1px); background:#fff; }
.input i{ font-size:18px; color:#6f8a75; }
.input input{ flex:1; background:transparent; border:0; outline:0; color:var(--text); font-size:15px; }
.input input::placeholder{ color:#93a69a }

.muted{ color: var(--muted); font-size: 12px; }
.tiny{ font-size: 11px; opacity:.85; }
.error{ display:block; min-height:16px; color:#d83a3a; font-size:12px; margin-top:6px; }

/* Mostrar/ocultar por modo */
.admin-only.hidden{ display:none; }
.func-only.hidden{ display:none; }

/* Buttons */
.btn{
  margin-top:6px; width:100%; display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-weight:800; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color:#fff; border:0; border-radius:12px; padding:12px 14px; cursor:pointer;
  transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 18px rgba(47,141,42,.24);
}
.btn:hover{ filter:brightness(1.03) }
.btn:active{ transform: translateY(1px) }
.btn:disabled{ opacity:.7; cursor:not-allowed; }
.btn.ghost{ background:#fff; color:var(--accent-2); border:1px solid var(--stroke); box-shadow:none; }
.btn.ghost:hover{ background:#f7fbf8; }

/* Calendário */
.calendar-card{ padding: 18px 18px 22px; }

.cal-header{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.cal-nav{ display:flex; align-items:center; gap:10px; }
.cal-title{ margin:0; font-size:20px; font-weight:800; letter-spacing:.2px; min-width:10ch; text-align:center; }
.nav-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:38px; height:38px; border-radius:10px; border:1px solid var(--stroke);
  background:#f7fbf8; cursor:pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
}
.nav-btn:hover{ background:#fff; border-color:#dfeae1; }
.nav-btn i{ font-size:20px; }

.logout-btn{
  display:inline-flex; align-items:center; gap:8px;
  height:38px; padding:0 12px;
  border-radius:10px; border:1px solid var(--stroke);
  background:#fff; color:var(--accent-2);
  font-weight:800; cursor:pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.logout-btn:hover{ background:#f7fbf8; border-color:#dfeae1; }
.logout-btn:active{ transform: translateY(1px); }

.cal-weekdays{
  display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; margin:6px 0 8px; color:var(--muted); font-size:12px; text-align:center;
}
.cal-grid{ display:grid; grid-template-columns: repeat(7, 1fr); gap:6px; }
.day{
  appearance:none; border:1px solid var(--stroke); border-radius:10px; background:#fff; min-height:44px;
  font:600 14px/1 Inter, system-ui, sans-serif; color:var(--text);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition: transform .06s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.day:hover{ box-shadow:0 0 0 4px rgba(47,141,42,.10); border-color:#dfeae1; }
.day:active{ transform: translateY(1px); }
.day.out{ color:#9bb1a2; background:#f7fbf8; }
.day.today{ outline: 2px solid rgba(47,141,42,.35); }
.day.selected{ background:linear-gradient(180deg, var(--accent), var(--accent-2)); color:#fff; border-color:transparent; }

/* Turnos (timeline) */
.turnos{ margin-top:16px; }
.turnos h3{ margin: 6px 0 10px; text-align:center; }

.timeline{
  list-style:none; margin:0 auto; padding:14px 0 4px;
  width:min(400px, 90%); position:relative;
}
.timeline::before{
  content:""; position:absolute; left:30px; top:0; bottom:0; width:6px;
  background: linear-gradient(#bfc8c2, #bfc8c2);
  border-radius: 99px;
}
.step{
  position:relative; display:flex; align-items:center; gap:12px;
  padding: 24px 0 24px 16px;
}
.step .dot{
  position:absolute; left:23px; width:20px; height:20px; border-radius:999px; background:#9aa29d;
  border:3px solid #cfd7d2;
}
.step .label{ margin-left:28px; font-weight:800; }
.step .status{ margin-left:auto; color:var(--muted); font-size:12px; }

/* Botão "Finalizar" estilo pílula */
.pill{
  margin-left:8px;
  border:0; border-radius:999px; padding:8px 14px; font-weight:800;
  background:#2e9d25; color:#fff; cursor:pointer;
  box-shadow:0 6px 14px rgba(46,157,37,.25);
  transition: transform .06s ease, filter .2s ease, opacity .2s ease;
}
.pill:hover{ filter:brightness(1.03); }
.pill:active{ transform: translateY(1px); }
.pill[disabled]{ opacity:.45; cursor:not-allowed; box-shadow:none; }

/* estados visuais */
.step.done .dot{ background:#2e9d25; border-color:#bfe8c0; }
.step.done .status{ color:#2e9d25; font-weight:700; }

/* Overlay de Sucesso (check animado) */
.success-overlay{
  position:fixed; inset:0; display:grid; place-items:center;
  background: radial-gradient(60rem 60rem at 50% 50%, rgba(233,246,234,.65), rgba(233,246,234,.35), rgba(233,246,234,0));
  backdrop-filter: blur(2px);
  opacity:0; pointer-events:none; transition: opacity .25s ease;
}
.success-overlay.show{ opacity:1; pointer-events:auto; }
.check-wrap{ text-align:center; color:var(--accent-2); }
.check-text{ margin-top:10px; font-weight:700; }
.check-svg{ width:min(48vmin, 220px); height:auto; }
.ring{ stroke: currentColor; opacity:.25; stroke-linecap: round; stroke-dasharray: 330; stroke-dashoffset: 330; }
.check{ stroke: currentColor; stroke-dasharray: 120; stroke-dashoffset: 120; }
.success-overlay.play .ring{ animation: ringFill .7s ease-out forwards; }
.success-overlay.play .check{ animation: drawCheck .5s ease-out .45s forwards; }
@keyframes ringFill{ to{ stroke-dashoffset: 0; } }
@keyframes drawCheck{ to{ stroke-dashoffset: 0; } }

/* Rodapé */
.foot{
  text-align:center;
  margin-top: 2vh;
  color: var(--muted);
  font-size: 12px;
}
.foot-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  flex-wrap:wrap;
  margin-bottom:.35rem;
}
.foot .copy{ font-weight:600; color: var(--text); }
.foot .sep{ opacity:.5; }

/* Crédito do desenvolvedor */
.developer-credit { opacity: 0.75; font-size: 0.8rem; }
.developer-credit a{ color: var(--accent-2); text-decoration: underline; }
.developer-credit a:hover{ filter: brightness(1.1); opacity: 1; }

.turnos-date strong{ color: var(--accent-2); }

/* Dots de presenças no calendário do funcionário */
#calGrid .day { position: relative; }
#calGrid .day .dots {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%);
  display: flex; gap: 4px;
}
#calGrid .day .dot {
  width: 8px; height: 8px; border-radius: 999px; background: #cfd7d2;
}
#calGrid .day .dot.ok { background: #2e9d25; }

/* ===== SELECT DE UNIDADE — FIX ===== */
.input select{
  flex:1;
  background:transparent;
  border:0;
  outline:0;
  color:var(--text);
  font-size:15px;
  font-family:inherit;
  cursor:pointer;
  appearance:none;
  padding:0;              /* remove padding interno que estourava o layout */
  height:20px;            /* deixa na mesma altura do input */
  line-height:20px;
}

/* Ajuste para centralizar verticalmente */
.input{
  padding: 10px 12px;
  height: 44px;           /* mesma altura dos outros inputs */
}

/* Placeholder estilizado */
.input select:invalid{
  color:#93a69a;
}

/* Ícone do select mais alinhado */
.input i{
  margin-top:1px;
}

.field-unidade .input {
  position: relative;
}

.field-unidade select {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  padding: 0;
  height: 20px;
  line-height: 20px;
}

/* opções da lista quando abre */
.field-unidade select option {
  background: #ffffff;          /* fundo branco */
  color: var(--text);           /* texto escuro */
  padding: 8px 10px;            /* dá um respiro */
}

/* placeholder "Selecionar unidade" */
.field-unidade select option[disabled] {
  color: #93a69a;
}

/* remove a setinha padrão no Edge/IE (se ainda usar) */
.field-unidade select::-ms-expand {
  display: none;
}

.field-unidade .input::after {
  content: "▾";
  position: absolute;
  right: 14px;
  font-size: 12px;
  color: #6f8a75;
  pointer-events: none;
}

#unidade {
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

/* linhas do menu aberto */
#unidade option {
  background: #ffffff;          /* fundo branco */
  color: var(--text);           /* texto padrão */
  padding: 6px 10px;            /* respiro interno */
}

/* placeholder */
#unidade option[disabled] {
  color: #93a69a;
}

/* opção selecionada / focada com highlight verde */
#unidade option:checked,
#unidade option:focus,
#unidade option:hover {
  background: var(--accent-soft);
  color: var(--accent-2);
}

/* ===== ESTILIZAÇÃO DO DROPDOWN (SELECT) ===== */
.field-unidade {
  position: relative;
}

.field-unidade .input {
  position: relative;
  cursor: pointer;
}

/* Seta personalizada para o select */
.field-unidade .input::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--muted);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.field-unidade .input:focus-within::after {
  color: var(--accent);
  transform: translateY(-50%) rotate(180deg);
}

/* Select principal */
.field-unidade select {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  padding: 0;
  height: 20px;
  line-height: 20px;
  padding-right: 24px; /* Espaço para a seta */
}

/* Placeholder estilizado */
.field-unidade select:invalid {
  color: #93a69a;
}

/* Opções do dropdown (quando aberto) */
.field-unidade select option {
  background: #ffffff;
  color: var(--text);
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--stroke);
  transition: background-color 0.2s ease;
}

/* Remove a borda da última opção */
.field-unidade select option:last-child {
  border-bottom: none;
}

/* Opção selecionada/focada */
.field-unidade select option:checked,
.field-unidade select option:focus,
.field-unidade select option:hover {
  background: var(--accent-soft);
  color: var(--accent-2);
}

/* Placeholder (opção desabilitada) */
.field-unidade select option[disabled] {
  color: #93a69a;
  background: #f7fbf8;
  font-style: italic;
}

/* Estados de hover e focus melhorados */
.field-unidade .input:hover {
  border-color: #dfeae1;
  background: #f0f7f1;
}

.field-unidade .input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 141, 42, 0.12);
  transform: translateY(-1px);
  background: #fff;
}

/* Remove a seta padrão no IE/Edge */
.field-unidade select::-ms-expand {
  display: none;
}

/* Melhoria visual para quando há um valor selecionado */
.field-unidade select:valid {
  color: var(--text);
  font-weight: 500;
}

/* Animações suaves */
.field-unidade select,
.field-unidade .input {
  transition: all 0.2s ease;
}

/* ===== TOGGLE NO HEADER ===== */
.mode-toggle.header-toggle {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(233, 246, 234, 0.95);
  border-radius: 999px;
  border: 1px solid var(--stroke);
  box-shadow: 0 4px 12px rgba(18, 61, 28, 0.08);
  font-size: 12px;
  color: var(--muted);
  z-index: 10;
  transition: all 0.2s ease;
}

.mode-toggle.header-toggle:hover {
  background: rgba(233, 246, 234, 1);
  box-shadow: 0 6px 16px rgba(18, 61, 28, 0.12);
  transform: translateY(-1px);
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 32px 22px 22px; /* Aumentado padding-top de 28px para 32px */
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(.98);
  opacity: 0;
  animation: enter .5s cubic-bezier(.2,.8,.2,1) .05s forwards;
}

#loginForm {
  position: relative;
  margin-top: 0; /* Reduzido de 10px para 0 */
}

/* Remove as regras antigas do toggle no form */
.form-toggle {
  display: none;
}

/* Switch mais compacto para o header */
.mode-toggle.header-toggle .switch {
  width: 42px;
  height: 22px;
}

.mode-toggle.header-toggle .slider:before {
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
}

.mode-toggle.header-toggle .switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* Label mais compacto */
.mode-toggle.header-toggle .toggle-label {
  font-size: 12px;
  font-weight: 600;
}

/* Ajuste responsivo para mobile */
@media (max-width: 480px) {
  .mode-toggle.header-toggle {
    top: 12px;
    right: 16px;
    padding: 5px 10px;
  }
  
  .mode-toggle.header-toggle .toggle-label {
    font-size: 11px;
  }
}

/* Ajuste responsivo: só diminuir o tamanho do toggle */
@media (max-width: 480px) {
  .mode-toggle.header-toggle {
    top: 12px;
    right: 12px;
    padding: 2px 4px;        /* menos largura */
    gap: 6px;                /* menos espaço entre switch e texto */
    max-width: 160px;        /* impede de ultrapassar o card */
  }

  .mode-toggle.header-toggle .toggle-label {
    font-size: 11px;         /* texto mais compacto */
  }

  .mode-toggle.header-toggle .switch {
    width: 38px;
    height: 20px;            /* switch menor */
  }

  .mode-toggle.header-toggle .slider:before {
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
  }

  .mode-toggle.header-toggle .switch input:checked + .slider:before {
    transform: translateX(16px);
  }
}
