/* ─────────────────────────────────────────────────────────────
   login.css — Portal Contagem RM
   Responsive: mobile-first (card layout) → desktop (split screen)
   ───────────────────────────────────────────────────────────── */

:root {
  --navy:       #1c3a5f;
  --navy-deep:  #142a47;
  --navy-soft:  #2a4d7a;
  --ink:        #0f1f33;
  --muted:      #6b7a8e;
  --line:       #e6ebf2;
  --bg:         #e9edf3;
  --accent:     #f5a524;
  --ok:         #0f7a3a;
  --ok-bg:      rgba(34, 197, 94, 0.14);
  --ok-border:  rgba(34, 197, 94, 0.32);
  --err:        #b42318;
  --err-bg:     #fff5f5;
  --err-border: #ffd6d6;
  --radius-lg:  22px;
  --radius-md:  12px;
  --radius-sm:  10px;
  --shadow-card: 0 12px 40px rgba(20, 42, 71, 0.10);
  --shadow-btn:  0 1px 0 rgba(15,31,51,0.04), 0 2px 6px rgba(15,31,51,0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; }

/* ─── Page layout ─────────────────────────────────────────── */
.lg-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ─── Brand panel (top on mobile, left on desktop) ────────── */
.lg-brand {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff;
  padding: 78px 28px 64px;
  text-align: center;
}

.lg-brand__pattern {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: 1;
}

.lg-brand__glow {
  position: absolute;
  top: -120px; right: -80px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,165,36,0.13) 0%, transparent 65%);
  pointer-events: none;
}

.lg-brand__content {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
}

.lg-logo-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  font-weight: 600; letter-spacing: 0.5px;
  font-size: 14px;
}

.lg-logo-chip__text { opacity: .92; }

.lg-brand__title {
  margin: 14px 0 0;
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.15;
}

.lg-brand__subtitle {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(255,255,255,0.62);
  letter-spacing: 0.2px;
}

.lg-status-pill {
  margin-top: 12px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  font-size: 11.5px; font-weight: 500;
  color: #86efac;
  letter-spacing: 0.2px;
}

.lg-status-pill__dot {
  width: 8px; height: 8px; border-radius: 99px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}

/* Marketing copy — only visible on desktop split */
.lg-brand__pitch { display: none; }

/* ─── Form panel (below on mobile, right on desktop) ──────── */
.lg-form-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0 16px;
  position: relative;
}

.lg-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  margin-top: -35px;        /* overlap with brand on mobile */
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px 24px 24px;
  box-shadow: 0 -8px 30px rgba(20,42,71,0.06);
  display: flex;
  flex-direction: column;
}

.lg-card__hd {
 margin-top: -20px;
  margin-bottom: 10px;
}

.lg-card__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.lg-card__sub {
  margin: 5px 0 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* SSO button */
.lg-sso {
  appearance: none;
  width: 100%;
  height: 50px;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 600;
  letter-spacing: 0.1px;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 60ms ease;
}

.lg-sso:hover:not([disabled]) {
  border-color: var(--navy-soft);
  background: #f9fbfd;
}

.lg-sso:active:not([disabled]) {
  transform: translateY(1px);
}

.lg-sso[disabled] { cursor: default; }

.lg-sso[data-state="success"] {
  background: var(--ok);
  color: #fff;
  border-color: var(--ok);
}

.lg-sso__arrow { color: var(--muted); margin-left: 2px; }

/* Spinner */
.lg-spinner {
  width: 16px; height: 16px;
  animation: lg-spin .9s linear infinite;
}
@keyframes lg-spin { to { transform: rotate(360deg); } }

/* Error banner */
.lg-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  border-radius: 8px;
  display: flex; gap: 9px; align-items: flex-start;
  color: var(--err);
  font-size: 12.5px; line-height: 1.4;
}
.lg-error__title { font-weight: 600; }
.lg-error__hint { color: #7a1d12; margin-top: 2px; }

/* Security row */
.lg-sec {
  margin-top: 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.1px;
}
.lg-sec__icon { color: var(--ok); }

/* Divider */
.lg-divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}

/* Help block */
.lg-help {
  padding: 14px;
  background: #f6f8fb;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.lg-help__toggle {
  all: unset;
  cursor: pointer;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}

.lg-help__title {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink);
}

.lg-help__title svg { color: var(--navy); }

.lg-help__chev {
  font-size: 12px; color: var(--muted);
  transition: transform 180ms;
}

.lg-help[data-open="true"] .lg-help__chev { transform: rotate(90deg); }

.lg-help__body {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 8px;
}

.lg-help[data-open="false"] .lg-help__body { display: none; }

.lg-help-row {
  all: unset;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 150ms;
}
.lg-help-row:hover { border-color: #cdd6e2; }
.lg-help-row__label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.lg-help-row__hint  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.lg-help-row__arrow { color: var(--muted); }

/* Footer */
.lg-footer {
  margin-top: auto;
  padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10.5px; color: var(--muted);
  letter-spacing: 0.2px;
}

.lg-footer__links { display: flex; align-items: center; gap: 8px; }
.lg-foot-btn {
  all: unset; cursor: pointer;
  font-size: 10.5px; color: var(--muted);
  padding: 2px 6px; border-radius: 5px;
}
.lg-foot-btn:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.lg-footer__sep { opacity: .4; }

/* MS squares logo */
.lg-ms-squares {
  display: inline-block; width: 18px; height: 18px;
  flex-shrink: 0;
}

/* ─── Responsive: tablet ──────────────────────────────────── */
@media (min-width: 600px) {
  .lg-brand { padding: 60px 32px 80px; }
  .lg-card { margin-top: -40px; padding: 36px 32px 28px; }
}

/* ─── Responsive: desktop split ───────────────────────────── */
@media (min-width: 960px) {
  .lg-page {
    flex-direction: row;
    min-height: 100vh;
  }

  .lg-brand {
    flex: 0 0 45%;
    max-width: 620px;
    padding: 64px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
  }

  .lg-brand__content {
    align-items: flex-start;
    text-align: left;
    margin: 0;
    margin-top: 32px;
  }

  .lg-logo-chip { font-size: 15px; }

  .lg-brand__title {
    font-size: clamp(30px, 2.6vw, 42px);
    margin-top: 24px;
  }

  .lg-brand__subtitle {
    font-size: 14px;
  }

  /* Marketing pitch shown only on desktop */
  .lg-brand__pitch {
    display: grid;
    gap: 16px;
    margin-top: 56px;
    max-width: 440px;
  }

  .lg-pitch-item {
    display: flex; gap: 14px; align-items: flex-start;
  }
  .lg-pitch-item__icon {
    width: 36px; height: 36px;
    flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--accent);
  }
  .lg-pitch-item__title {
    font-size: 14px; font-weight: 600;
    margin: 4px 0 2px;
    color: #fff;
  }
  .lg-pitch-item__body {
    font-size: 12.5px;
    color: rgba(255,255,255,0.55);
    line-height: 1.5;
  }

  .lg-brand__footnote {
    position: relative;
    font-size: 11.5px;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.2px;
  }

  .lg-form-wrap {
    flex: 1;
    align-items: center;
    padding: 48px;
  }

  .lg-card {
    max-width: 440px;
    margin-top: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    min-height: 0;
  }
}

/* ─── Responsive: large desktop ───────────────────────────── */
@media (min-width: 1280px) {
  .lg-brand { padding: 80px 80px; }
  .lg-form-wrap { padding: 64px; }
}

/* ─── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lg-spinner, .lg-help__chev, .lg-sso { animation: none !important; transition: none !important; }
}

/* ─── Focus visible ───────────────────────────────────────── */
.lg-sso:focus-visible,
.lg-help__toggle:focus-visible,
.lg-help-row:focus-visible,
.lg-foot-btn:focus-visible {
  outline: 2px solid var(--navy-soft);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

.feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .feature-icon svg {
        width: 18px;
        height: 18px;
        stroke: #f5a524;
        fill: none;
        stroke-width: 1.5;
        stroke-linecap: round;
        stroke-linejoin: round;
    }



.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 13px;
    color: #991b1b;
    margin-bottom: 20px;
}


/* ─── BOTÃO MICROSOFT ─── */
.btn-microsoft {
    width: 100%;
    height: 48px;
    background: #fff;
    color: #1f2937;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.12s;
}

    .btn-microsoft:hover {
        background: #f3f4f6;
        border-color: #9ca3af;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        transform: translateY(-1px);
    }

    .btn-microsoft:active {
        transform: translateY(0);
        box-shadow: none;
        background: #e9eaeb;
    }

.ms-logo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

    .ms-logo span {
        display: block;
        border-radius: 1px;
    }

    .ms-logo .ms-red {
        background: #f25022;
    }

    .ms-logo .ms-green {
        background: #7fba00;
    }

    .ms-logo .ms-blue {
        background: #00a4ef;
    }

    .ms-logo .ms-yellow {
        background: #ffb900;
    }

.microsoft-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}
#btnSpinner {
    display: none;
}

#btnLogin:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

#btnLogin.is-loading #btnSpinner {
    display: inline-block;
}