/* ============================================================
   PPLeds — login.css — Layout base da página
   ============================================================ */

/* Página de login: fundo preto, flex column, ocupa viewport inteiro */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--black);
}

/* Background decorativo */
.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(245,200,66,.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(245,200,66,.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.page-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* Header próprio da página de login */
header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.header-inner {
  width: 100%;
  box-sizing: border-box;
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 30px;
}

.header-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gray);
  text-decoration: none;
  transition: color .2s;
}
.header-back:hover { color: var(--gold); }

/* Wrap externo para empurrar conteúdo ao centro */
.auth-layout {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* Footer mínimo */
footer {
  padding: 20px 30px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
footer .footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #444;
}
footer .footer-inner a { color: #555; text-decoration: none; }

.auth-layout {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 480px;
    max-width: 1140px;
    margin: 0 auto;
    padding: 20px 30px 60px;
    gap: 80px;
    align-items: center;
    width: 100%;
  }

  /* ── LEFT PANEL (brand) ── */
  .auth-brand {
    padding: 20px 0;
  }

  .brand-tag {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(245,200,66,.1);
    border: 1px solid rgba(245,200,66,.25);
    color: var(--gold); font-size: 11px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    padding: 6px 14px; border-radius: 20px; margin-bottom: 28px;
  }

  .brand-tag::before {
    content: ''; width: 6px; height: 6px;
    background: var(--gold); border-radius: 50%;
    animation: pulse 2s infinite;
  }

  @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

  .brand-headline {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(42px, 5vw, 72px);
    line-height: .95; letter-spacing: 2px;
    margin-bottom: 22px;
  }

  .brand-headline span { color: var(--gold); display: block; }

  .brand-desc {
    font-size: 15px; color: var(--gray);
    line-height: 1.8; max-width: 400px; margin-bottom: 40px;
  }

  .brand-perks {
    display: flex; flex-direction: column; gap: 14px;
  }

  .brand-perk {
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; color: var(--gray);
  }

  .brand-perk-icon {
    width: 34px; height: 34px;
    background: rgba(245,200,66,.08);
    border: 1px solid rgba(245,200,66,.15);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: var(--gold); flex-shrink: 0;
  }

  /* ── AUTH CARD ── */
  .auth-card {
    background: var(--dark2);
    border: 1px solid #2a2a2a;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,.5);
  }

  /* Tabs */
  .auth-tabs {
    display: grid; grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #222;
  }

  .auth-tab {
    padding: 16px;
    background: none; border: none;
    color: var(--gray); font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .2s;
    position: relative;
  }

  .auth-tab:hover { color: var(--white); }

  .auth-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
    background: rgba(245,200,66,.03);
  }

  /* Panels */
  .auth-panel { display: none; padding: 28px; }
  .auth-panel.active { display: block; animation: panelIn .3s ease; }

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

  /* ── FORM FIELDS ── */
  .field-group {
    margin-bottom: 16px;
    position: relative;
  }

  .field-group label {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; color: var(--gray); margin-bottom: 7px;
  }

  .field-group label a {
    font-size: 11px; color: var(--gold); text-decoration: none;
    font-weight: 600; letter-spacing: .5px; text-transform: none;
    transition: opacity .2s;
  }

  .field-group label a:hover { opacity: .7; }

  .field-wrap {
    position: relative;
  }

  .field-wrap svg.field-icon {
    position: absolute; left: 13px; top: 50%;
    transform: translateY(-50%);
    color: #555; pointer-events: none;
    transition: color .2s;
  }

  .field-group:focus-within .field-wrap svg.field-icon { color: var(--gold); }

  .field-wrap input {
    width: 100%;
    background: var(--dark3); border: 1px solid #2a2a2a;
    color: var(--white); padding: 12px 14px 12px 40px;
    border-radius: 8px; font-family: 'DM Sans', sans-serif;
    font-size: 14px; outline: none;
    transition: border-color .2s, box-shadow .2s;
  }

  .field-wrap input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245,200,66,.08);
  }

  .field-wrap input::placeholder { color: #3a3a3a; }

  .field-wrap input.error { border-color: var(--red); }
  .field-wrap input.success { border-color: var(--green); }

  .field-wrap .field-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #555; cursor: pointer;
    padding: 2px; transition: color .2s;
  }

  .field-wrap .field-toggle:hover { color: var(--gold); }

  .field-wrap .field-status {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    pointer-events: none;
  }

  .field-error {
    font-size: 11px; color: var(--red); margin-top: 5px;
    display: none; align-items: center; gap: 4px;
  }

  .field-error.visible { display: flex; }

  .field-hint {
    font-size: 11px; color: var(--gray); margin-top: 5px;
  }

  /* CNPJ status */
  .cnpj-status {
    margin-top: 8px; padding: 10px 12px;
    border-radius: 7px; font-size: 12px;
    display: none; align-items: center; gap: 8px;
  }

  .cnpj-status.loading { display: flex; background: var(--dark3); border: 1px solid #2a2a2a; color: var(--gray); }
  .cnpj-status.ok      { display: flex; background: rgba(46,204,113,.08); border: 1px solid rgba(46,204,113,.2); color: var(--green); }
  .cnpj-status.err     { display: flex; background: rgba(231,76,60,.08); border: 1px solid rgba(231,76,60,.2); color: var(--red); }

  /* Password strength */
  .password-strength { margin-top: 8px; }

  .strength-bar {
    height: 3px; border-radius: 2px;
    background: #2a2a2a; margin-bottom: 5px;
    overflow: hidden;
  }

  .strength-fill {
    height: 100%; width: 0;
    border-radius: 2px;
    transition: width .4s ease, background .4s;
  }

  .strength-label {
    font-size: 11px; color: var(--gray);
    display: flex; justify-content: space-between;
  }

  .strength-label span { font-weight: 600; }

  /* Form divider */
  .form-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0; color: var(--gray); font-size: 11px;
    letter-spacing: 1px; text-transform: uppercase;
  }

  .form-divider::before, .form-divider::after {
    content: ''; flex: 1; height: 1px; background: #222;
  }

  /* Step progress (register) */
  .register-steps {
    display: flex; gap: 6px; margin-bottom: 24px;
  }

  .reg-step-dot {
    flex: 1; height: 3px; border-radius: 2px;
    background: #2a2a2a; transition: background .3s;
  }

  .reg-step-dot.active { background: var(--gold); }
  .reg-step-dot.done { background: var(--green); }

  .register-step { display: none; }
  .register-step.active { display: block; animation: panelIn .25s ease; }

  .step-title {
    font-size: 11px; font-weight: 700; letter-spacing: 2px;
    text-transform: uppercase; color: var(--gray); margin-bottom: 18px;
    display: flex; align-items: center; justify-content: space-between;
  }

  .step-title-num {
    font-family: 'Space Mono', monospace; font-size: 10px;
    color: var(--gold);
  }

  /* Buttons */
  .btn-primary {
    width: 100%; background: var(--gold); color: var(--black);
    border: none; padding: 14px;
    font-family: 'DM Sans', sans-serif; font-size: 13px;
    font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
    border-radius: 8px; cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 9px;
  }

  .btn-primary:hover { background: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 24px rgba(245,200,66,.25); }
  .btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

  .btn-primary.loading {
    pointer-events: none; opacity: .8;
  }

  .btn-secondary {
    width: 100%; background: none;
    border: 1px solid #333; color: var(--white);
    padding: 13px; border-radius: 8px;
    font-family: 'DM Sans', sans-serif; font-size: 13px;
    font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; justify-content: center; gap: 9px;
  }

  .btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

  .btn-ghost-sm {
    background: none; border: none; color: var(--gold);
    font-family: 'DM Sans', sans-serif; font-size: 12px;
    font-weight: 600; cursor: pointer; padding: 0;
    display: flex; align-items: center; gap: 5px;
    transition: opacity .2s;
  }

  .btn-ghost-sm:hover { opacity: .7; }

  /* Terms checkbox */
  .terms-row {
    display: flex; align-items: flex-start; gap: 10px;
    margin-bottom: 18px;
  }

  .terms-row input[type="checkbox"] {
    width: 16px; height: 16px; margin-top: 2px;
    accent-color: var(--gold); cursor: pointer; flex-shrink: 0;
  }

  .terms-row span {
    font-size: 12px; color: var(--gray); line-height: 1.6;
  }

  .terms-row a { color: var(--gold); text-decoration: none; }

  /* Auth footer */
  .auth-footer {
    padding: 16px 28px;
    border-top: 1px solid #1e1e1e;
    text-align: center;
    font-size: 12px; color: var(--gray);
  }

  .auth-footer a { color: var(--gold); text-decoration: none; font-weight: 600; }
  .auth-footer a:hover { opacity: .8; }

  /* Recovery panel */
  .recovery-panel {
    display: none; padding: 28px;
    animation: panelIn .3s ease;
  }

  .recovery-panel.active { display: block; }

  .recovery-back {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--gray); font-weight: 600;
    cursor: pointer; margin-bottom: 22px; background: none;
    border: none; font-family: 'DM Sans', sans-serif;
    transition: color .2s; padding: 0;
  }

  .recovery-back:hover { color: var(--gold); }

  /* ── SPINNER ── */
  @keyframes spin { to { transform: rotate(360deg); } }

  .spinner {
    width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.2);
    border-top-color: var(--black); border-radius: 50%;
    animation: spin .6s linear infinite; flex-shrink: 0;
  }

  /* ── TOAST ── */
  .toast {
    position: fixed; bottom: 28px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--dark2); border: 1px solid #333;
    border-radius: 10px; padding: 13px 18px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    z-index: 9999; transition: transform .35s cubic-bezier(.34,1.56,.64,1);
    white-space: nowrap;
  }

  .toast.show { transform: translateX(-50%) translateY(0); }
  .toast.error svg { color: var(--red); }
  .toast svg { color: var(--green); }

  /* ── FOOTER ── */
  footer {
    position: relative; z-index: 1;
    border-top: 1px solid #1a1a1a;
    padding: 20px 30px;
  }

  .footer-inner {
    max-width: 1140px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
  }

  .footer-inner p { font-size: 11px; color: #444; }
  .footer-inner a { color: var(--gold); text-decoration: none; }

  /* ── RESPONSIVE ── */
  @media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; gap: 40px; }
    .auth-brand { display: none; }
  }

  @media (max-width: 540px) {
    .auth-layout { padding: 16px 16px 40px; }
    .header-inner { padding: 18px 16px; }
    .auth-panel { padding: 22px 18px; }
    .recovery-panel { padding: 22px 18px; }
    .auth-footer { padding: 14px 18px; }
  }
