/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN - Design System
   Consistente com projeto.css, extracao.css e processos.css
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-page: #e4e5e6;
  --bg-sidebar: #1a1a1a;
  --bg-card: #ffffff;
  --bg-card-dark: #2a2a2a;
  --bg-accent: #d4e157;
  
  /* Text colors */
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-light: rgba(255, 255, 255, 0.9);
  --text-light-muted: rgba(255, 255, 255, 0.6);
  
  /* Accent colors */
  --accent-primary: #d4e157;
  --accent-green: #22c55e;
  --accent-green-dark: #16a34a;
  --accent-hover: #c9d64c;
  
  /* Borders & shadows */
  --border-light: rgba(0, 0, 0, 0.08);
  --border-dark: rgba(255, 255, 255, 0.1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 32px 80px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
  
  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-main);
  background: var(--bg-page);
  color: var(--text-primary);
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Decorative background circles */
body::before {
  content: '';
  position: fixed;
  top: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  border: 1px solid rgba(26, 26, 26, 0.08);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  bottom: -150px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(26, 26, 26, 0.05);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.05); }
}

/* ── Page Container ── */
.page {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* ── Main Card ── */
.card {
  display: flex;
  width: 100%;
  max-width: 1040px;
  min-height: 640px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: cardReveal 1.1s var(--ease-out) both;
  outline: 1px solid rgba(255, 255, 255, 0.4);
  outline-offset: -1px;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* ── Left Panel (Dark) ── */
.card-left {
  flex: 1.2;
  position: relative;
  display: flex;
  padding: 14px;
  background: var(--bg-sidebar);
  overflow: hidden;
}

.card-left::before {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(26, 26, 26, 0.92) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(26, 26, 26, 0.5) 0%, transparent 60%);
  z-index: 2;
  pointer-events: none;
}

.card-left::after {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 18px;
  border: 1px solid rgba(212, 225, 87, 0.2);
  box-shadow: inset 0 0 60px rgba(212, 225, 87, 0.03);
  z-index: 3;
  pointer-events: none;
}

/* Grid pattern overlay */
.grid-overlay {
  position: absolute;
  inset: 14px;
  border-radius: 18px;
  background-image:
    linear-gradient(rgba(212, 225, 87, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 225, 87, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
}

.left-content {
  position: absolute;
  inset: 14px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
}

.left-logo {
  position: absolute;
  top: 36px;
  left: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.left-logo-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.left-logo-circle svg {
  width: 18px;
  height: 18px;
  stroke: var(--bg-sidebar);
  stroke-width: 2;
}

.left-logo-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: -0.01em;
}

.left-tagline {
  animation: badgeReveal 1s var(--ease-out) 0.7s both;
}

@keyframes badgeReveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-primary);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 6px var(--accent-primary); opacity: 1; }
  50% { box-shadow: 0 0 16px var(--accent-primary); opacity: 0.7; }
}

.stat-text {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-light-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  padding: 8px 18px 8px 12px;
}

.badge-text {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-light-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Decorative chart bars */
.deco-bars {
  position: absolute;
  bottom: 110px;
  right: 36px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  z-index: 4;
  opacity: 0.5;
}

.deco-bar {
  width: 6px;
  border-radius: 3px 3px 0 0;
  background: var(--accent-primary);
}

/* ── Right Panel (Light) ── */
.card-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 48px;
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.card-right::after {
  content: '';
  position: absolute;
  top: -90px;
  right: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 28px solid var(--accent-primary);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  animation: arcSpin 50s linear infinite;
}

@keyframes arcSpin {
  to { transform: rotate(360deg); }
}

.form-wrapper {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  z-index: 1;
  animation: formReveal 1s var(--ease-out) 0.25s both;
}

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

/* ── Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 44px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent-primary);
  stroke-width: 2;
}

.logo-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ── Eyebrow ── */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.eyebrow-line {
  width: 22px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 2px;
}

.eyebrow-text {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Heading ── */
.heading {
  font-family: var(--font-main);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 10px;
  width: 100%;
}

.subheading {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 36px;
  width: 100%;
}

/* ── Microsoft Button ── */
.btn-microsoft {
  width: 100%;
  padding: 14px 24px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-main);
  letter-spacing: 0.01em;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn-microsoft::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(0, 164, 239, 0.06) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s var(--ease-out);
}

.btn-microsoft:hover::before {
  transform: translateX(160%);
}

.btn-microsoft:hover {
  border-color: #00a4ef;
  box-shadow: 0 4px 20px rgba(0, 164, 239, 0.12);
  transform: translateY(-2px);
}

.btn-microsoft:active {
  transform: translateY(0) scale(0.985);
}

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

.ms-logo span {
  display: block;
  width: 8px;
  height: 8px;
}

/* ── Divider ── */
.divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
}

.divider-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── SSO Button (Portal) ── */
.btn-sso {
  width: 100%;
  padding: 14px 24px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-main);
  color: var(--bg-sidebar);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
}

.btn-sso svg {
  stroke: var(--bg-sidebar);
}

.btn-sso:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(212, 225, 87, 0.3);
}

.btn-sso:active {
  transform: translateY(0) scale(0.985);
}

/* ── Info Box ── */
.info-box {
  margin-top: 28px;
  width: 100%;
  padding: 14px 16px;
  background: rgba(212, 225, 87, 0.15);
  border: 1px solid rgba(212, 225, 87, 0.4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.info-box-icon {
  flex-shrink: 0;
  color: var(--bg-sidebar);
  margin-top: 1px;
}

.info-box-text {
  font-size: 0.74rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.info-box-text strong {
  font-weight: 700;
}

/* ── Error Message ── */
.error-msg {
  display: none;
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: #dc2626;
  text-align: center;
}

.error-msg.show {
  display: block;
  animation: shakeError 0.5s ease-out;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ── Footer ── */
.login-footer {
  margin-top: 32px;
  width: 100%;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.login-footer a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.login-footer a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .card {
    max-width: 100%;
    min-height: auto;
  }
  
  .card-left {
    flex: 1;
  }
  
  .card-right {
    padding: 40px 36px;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow: auto;
    height: auto;
  }
  
  .page {
    overflow: auto;
    height: auto;
    min-height: 100vh;
    padding: 0;
  }
  
  .card {
    flex-direction: column;
    border-radius: 0;
    max-width: 100%;
    min-height: 100vh;
    box-shadow: none;
    outline: none;
  }
  
  .card-left {
    height: 200px;
    flex: none;
    padding: 8px;
  }
  
  .left-logo {
    top: 24px;
    left: 24px;
  }
  
  .left-content {
    padding: 24px;
  }
  
  .card-right {
    flex: 1;
    padding: 36px 24px 48px;
  }
  
  .card-right::after {
    display: none;
  }
  
  .form-wrapper {
    max-width: 100%;
  }
  
  .heading {
    font-size: 2rem;
  }
  
  .logo {
    margin-bottom: 32px;
  }
  
  .deco-bars {
    display: none;
  }
  
  .stats-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .card-left {
    height: 180px;
  }
  
  .left-logo-circle {
    width: 32px;
    height: 32px;
  }
  
  .left-logo-name {
    font-size: 0.9rem;
  }
  
  .stat-pill {
    padding: 6px 10px;
  }
  
  .stat-text {
    font-size: 0.62rem;
  }
  
  .card-right {
    padding: 28px 20px 40px;
  }
  
  .heading {
    font-size: 1.75rem;
  }
  
  .subheading {
    font-size: 0.78rem;
    margin-bottom: 28px;
  }
  
  .btn-microsoft,
  .btn-sso {
    padding: 12px 20px;
    font-size: 0.78rem;
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Selection ── */
::selection {
  background: rgba(212, 225, 87, 0.3);
  color: var(--text-primary);
}

/* ── Focus States ── */
.btn-microsoft:focus-visible,
.btn-sso:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}