/* === Tokens dark (login) === */
:root {
  --bg:          #0a0e14;
  --bg-card:     #131820;
  --bg-elevated: #1a2028;

  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text:        #e8eaed;
  --text-muted:  #9ba3af;
  --text-faint:  #6b7280;

  --accent:        #4ba3d4;
  --accent-hover:  #5fb2dd;
  --accent-soft:   rgba(75, 163, 212, 0.15);

  --error:         #f87171;
  --error-bg:      rgba(248, 113, 113, 0.08);
  --error-border:  rgba(248, 113, 113, 0.20);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --r-sm: 6px;
  --r-md: 8px;

  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:      200ms;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input { font: inherit; color: inherit; }
[x-cloak] { display: none !important; }

/* === Layout === */
.login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  width: 100vw;
}

/* === Hero (left) === */
.hero {
  position: relative;
  overflow: hidden;
  background-color: #0a0e14;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1625246333195-78d9c38ad449?w=1600&q=80');
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: imageFade 800ms var(--ease-out) forwards;
}
@keyframes imageFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10, 14, 20, 0.70) 0%, rgba(14, 69, 96, 0.55) 100%);
}
.hero-center {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.hero-headline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 56px;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1;
  opacity: 0;
  animation: headlineUp 600ms var(--ease-out) 200ms forwards;
}
@keyframes headlineUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-logo {
  position: absolute;
  bottom: 32px;
  right: 32px;
  width: 64px;
  height: 64px;
  object-fit: contain;
  z-index: 3;
  opacity: 0;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  animation: logoIn 400ms var(--ease-out) 600ms forwards;
}
@keyframes logoIn {
  from { opacity: 0; }
  to   { opacity: 0.85; }
}

/* === Form panel (right) === */
.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 32px;
}
.form-block {
  width: 100%;
  max-width: 360px;
}
.form-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}
.form-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 40px;
  letter-spacing: 0.005em;
}

.fields { display: flex; flex-direction: column; gap: 16px; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 7px;
}
.field-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 15px;
  font-family: var(--font-body);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field-input::placeholder { color: var(--text-faint); }
.field-input:hover { border-color: var(--border-strong); }
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-input.has-error {
  border-color: var(--error-border);
}
.field-input.has-error:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px var(--error-bg);
}

/* Error message box */
.error-box {
  margin-top: 16px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--error);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--r-sm);
  animation: errorIn 200ms var(--ease-out);
}
@keyframes errorIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Submit button */
.btn-submit {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  background: var(--accent);
  color: #0a0e14;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.005em;
  border-radius: var(--r-md);
  transition:
    background-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}
.btn-submit:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}
.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-foot {
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
}

/* === Stagger animations === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 600ms var(--ease-out) both; }
.delay-1 { animation-delay: 300ms; }
.delay-2 { animation-delay: 460ms; }
.delay-3 { animation-delay: 600ms; }
.delay-form { animation-delay: 400ms; }

@media (prefers-reduced-motion: reduce) {
  .hero-image, .fade-up { animation: none; opacity: 1; transform: none; }
}

/* === Responsive === */
/* Tablet: mantém split 50/50 com headline menor */
@media (max-width: 1279px) and (min-width: 768px) {
  .hero-headline { font-size: 40px; }
}

/* Mobile large: hero vira faixa de 30vh no topo */
@media (max-width: 767px) {
  body { overflow: auto; }
  .login {
    grid-template-columns: 1fr;
    grid-template-rows: 30vh 1fr;
    height: auto;
    min-height: 100vh;
  }
  .hero-headline { font-size: 30px; }
  .hero-logo {
    width: 44px;
    height: 44px;
    bottom: 16px;
    right: 16px;
  }
  .form-panel { padding: 36px 24px; }
  .form-block { max-width: 100%; }
  .form-title { font-size: 26px; }
  .form-subtitle { margin-bottom: 28px; }
}

/* Mobile small */
@media (max-width: 479px) {
  .login { grid-template-rows: 26vh 1fr; }
  .hero-headline { font-size: 24px; }
  .hero-logo { width: 40px; height: 40px; bottom: 12px; right: 12px; }
  .form-panel { padding: 28px 18px; }
  .form-title { font-size: 24px; }
  .btn-submit { padding: 14px; }
}
