/* ============================================================
   P8W Contábil SST — Auth Pages CSS
   Redesign Big-Tech 2026-04-24 — Dark Premium
   ============================================================ */

/* ─── Auth Body ── */
.auth-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #09090b;
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

/* Mesh background */
.auth-body::before,
.auth-body::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: floatOrb 10s ease-in-out infinite;
}
.auth-body::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,.12) 0%, transparent 65%);
  top: -160px; right: -160px;
  animation-delay: 0s;
}
.auth-body::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,.09) 0%, transparent 65%);
  bottom: -130px; left: -130px;
  animation-delay: -5s;
}
@keyframes floatOrb {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-24px) scale(1.04); }
}

/* Grid decoration */
.auth-body .auth-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

/* ─── Auth Container ── */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* ─── Auth Card ── */
.auth-card {
  background: rgba(24,24,27,.9);
  width: 100%;
  max-width: 432px;
  border-radius: 18px;
  padding: 2.25rem 2rem;
  box-shadow: 0 24px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.07);
  position: relative;
  overflow: hidden;
  animation: cardEntrance .4s cubic-bezier(0.22, 1, 0.36, 1) both;
  backdrop-filter: blur(24px);
}
.auth-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(59,130,246,.08) 0%, transparent 70%);
  pointer-events: none;
}
@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Auth Logo ── */
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 14px;
  font-size: 1.75rem; line-height: 1;
  box-shadow: 0 8px 24px rgba(59,130,246,.4), 0 0 0 4px rgba(59,130,246,.12);
  margin-bottom: .875rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.auth-logo-icon:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 32px rgba(59,130,246,.5), 0 0 0 4px rgba(59,130,246,.15);
}
.auth-logo-text {
  font-size: 1.375rem; font-weight: 800;
  color: #fafafa;
  letter-spacing: -0.035em; margin: 0; line-height: 1.2;
}
.auth-logo-sub {
  display: block; color: rgba(255,255,255,.38);
  font-size: .775rem; margin-top: .3rem;
  font-weight: 400; letter-spacing: .01em;
}

/* ─── Auth Form ── */
.auth-form {
  display: flex; flex-direction: column;
  gap: .25rem; margin-top: 1.5rem;
}
.auth-form .form-group { margin-bottom: .875rem; }
.auth-form .form-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .775rem; font-weight: 600;
  color: rgba(255,255,255,.65);
  margin-bottom: .375rem; letter-spacing: .005em;
}
.form-label-link {
  font-size: .725rem; font-weight: 500;
  color: var(--color-primary-400, #60a5fa);
  transition: color .15s;
}
.form-label-link:hover { color: var(--color-primary-300, #93c5fd); text-decoration: underline; }

/* Form inputs */
.auth-form .form-input {
  width: 100%;
  padding: .6rem .875rem;
  font-size: .875rem;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px;
  color: #fafafa;
  transition: border-color .18s, box-shadow .18s, background .18s;
  outline: none; line-height: 1.5;
  font-family: inherit;
}
.auth-form .form-input:focus {
  background: rgba(255,255,255,.08);
  border-color: rgba(59,130,246,.6);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.auth-form .form-input::placeholder { color: rgba(255,255,255,.22); }

/* Input group (password with eye) */
.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .form-input { padding-right: 2.75rem; }
.input-addon {
  position: absolute; right: 0; top: 0;
  height: 100%; width: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  font-size: .9rem; color: rgba(255,255,255,.28);
  border-radius: 0 9px 9px 0;
  transition: color .15s; padding: 0;
}
.input-addon:hover { color: var(--color-primary-400, #60a5fa); }

/* Auth primary button */
.auth-form .btn-primary,
.auth-form .btn.btn-primary {
  display: flex; align-items: center; justify-content: center;
  gap: .4rem; width: 100%;
  padding: .7rem 1.5rem;
  font-size: .9rem; font-weight: 600;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff; border: none;
  border-radius: 9px; cursor: pointer;
  transition: transform .15s, box-shadow .15s, filter .15s;
  box-shadow: 0 4px 14px rgba(59,130,246,.4);
  letter-spacing: -0.01em; margin-top: .375rem;
  font-family: inherit;
}
.auth-form .btn-primary:hover,
.auth-form .btn.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59,130,246,.5);
}
.auth-form .btn-primary:active,
.auth-form .btn.btn-primary:active { transform: translateY(0); filter: brightness(.97); }
.auth-form .btn-primary:disabled,
.auth-form .btn.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-full { width: 100%; justify-content: center; }

/* ─── Auth Links ── */
.auth-links { text-align: center; margin-top: 1.125rem; }
.auth-link-small { font-size: .75rem; color: rgba(255,255,255,.3); transition: color .15s; }
.auth-link-small:hover { color: var(--color-primary-400, #60a5fa); }

/* ─── Auth Footer ── */
.auth-footer {
  text-align: center; margin-top: 1.375rem;
  color: rgba(255,255,255,.2); font-size: .7rem;
  position: relative; z-index: 1;
}
.auth-footer a { color: rgba(255,255,255,.28); }
.auth-footer a:hover { color: rgba(255,255,255,.5); }

/* ─── Alerts inside card ── */
.auth-card .alert {
  padding: .65rem .875rem;
  border-radius: 9px; font-size: .8125rem;
  margin-bottom: .875rem; border: 1px solid transparent;
  display: flex; align-items: flex-start; gap: .5rem;
}
.auth-card .alert-danger  { background: rgba(244,63,94,.12);  color: #fda4af; border-color: rgba(244,63,94,.25); }
.auth-card .alert-success { background: rgba(16,185,129,.12); color: #6ee7b7; border-color: rgba(16,185,129,.25); }
.auth-card .alert-warning { background: rgba(245,158,11,.12); color: #fcd34d; border-color: rgba(245,158,11,.25); }
.auth-card .alert-info    { background: rgba(59,130,246,.12); color: #93c5fd; border-color: rgba(59,130,246,.25); }

/* ─── OTP / 2FA ── */
.otp-input {
  text-align: center; font-size: 2rem; font-weight: 700;
  letter-spacing: .6rem;
  font-family: var(--font-mono, 'SF Mono', 'Fira Code', monospace);
  padding: .8rem 1rem .8rem 1.6rem;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 11px; color: #fafafa;
  transition: border-color .18s, box-shadow .18s; width: 100%;
}
.otp-input:focus {
  background: rgba(255,255,255,.08);
  border-color: rgba(59,130,246,.6);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18); outline: none;
}
.otp-timer { text-align: center; font-size: .775rem; color: rgba(255,255,255,.3); margin-top: .5rem; }

/* ─── Security icon ── */
.auth-security-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  border-radius: 14px; font-size: 1.75rem;
  box-shadow: 0 8px 24px rgba(6,182,212,.4), 0 0 0 4px rgba(6,182,212,.12);
  margin-bottom: .875rem;
}

/* ─── Back link ── */
.auth-back-link {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .775rem; font-weight: 500;
  color: rgba(255,255,255,.3); margin-bottom: 1.375rem;
  transition: color .15s, gap .15s; text-decoration: none;
}
.auth-back-link:hover { color: var(--color-primary-400, #60a5fa); gap: .5rem; }
.auth-back-link svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ─── Section Label ── */
.auth-section-label {
  text-align: center; font-size: .675rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.25);
  margin: -.5rem 0 1.125rem;
  padding: .3rem 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px; display: inline-block; width: 100%;
  background: rgba(255,255,255,.03);
}

/* ─── Divider ── */
.auth-divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1.125rem 0; color: rgba(255,255,255,.2); font-size: .7rem;
}
.auth-divider::before,
.auth-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.08);
}

/* Light mode overrides (quando não dark) */
@media (prefers-color-scheme: light) {
  :not([data-theme="dark"]) .auth-body { background: #f4f4f5; }
  :not([data-theme="dark"]) .auth-card {
    background: #fff;
    border-color: rgba(0,0,0,.07);
    box-shadow: 0 8px 32px rgba(0,0,0,.1), 0 0 0 1px rgba(0,0,0,.04);
    backdrop-filter: none;
  }
  :not([data-theme="dark"]) .auth-logo-text { color: #18181b; }
  :not([data-theme="dark"]) .auth-logo-sub { color: #71717a; }
  :not([data-theme="dark"]) .auth-form .form-label { color: #3f3f46; }
  :not([data-theme="dark"]) .auth-form .form-input {
    background: #fafafa; border-color: #d1d1d6; color: #18181b;
  }
  :not([data-theme="dark"]) .auth-form .form-input:focus { background: #fff; }
  :not([data-theme="dark"]) .auth-form .form-input::placeholder { color: #a1a1aa; }
  :not([data-theme="dark"]) .input-addon { color: #a1a1aa; }
  :not([data-theme="dark"]) .auth-link-small { color: #71717a; }
  :not([data-theme="dark"]) .auth-footer { color: #a1a1aa; }
  :not([data-theme="dark"]) .auth-footer a { color: #71717a; }
  :not([data-theme="dark"]) .auth-divider { color: #d1d1d6; }
  :not([data-theme="dark"]) .auth-divider::before,
  :not([data-theme="dark"]) .auth-divider::after { background: #e4e4e7; }
  :not([data-theme="dark"]) .auth-back-link { color: #71717a; }
  :not([data-theme="dark"]) .auth-section-label { color: #a1a1aa; border-color: #e4e4e7; background: #fafafa; }
  :not([data-theme="dark"]) .auth-card .alert-danger  { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
  :not([data-theme="dark"]) .auth-card .alert-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
  :not([data-theme="dark"]) .auth-card .alert-warning { background: #fffbeb; color: #d97706; border-color: #fef3c7; }
  :not([data-theme="dark"]) .auth-card .alert-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
  :not([data-theme="dark"]) .otp-input { background: #fafafa; border-color: #d1d1d6; color: #18181b; }
}

/* ─── Responsive ── */
@media (max-width: 600px) {
  .auth-container { padding: 1rem; align-items: flex-start; padding-top: 1.75rem; }
  .auth-card { padding: 1.75rem 1.375rem; border-radius: 14px; width: 100%; max-width: 100%; }
  .auth-logo-text { font-size: 1.2rem; }
}
@media (max-width: 480px) {
  .auth-container { padding: .75rem; padding-top: 1.25rem; }
  .auth-card { padding: 1.5rem 1.125rem; border-radius: 14px; }
  .auth-logo-icon, .auth-security-icon { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 12px; }
  .otp-input { font-size: 1.75rem; letter-spacing: .45rem; }
  input, select, textarea { font-size: 1rem !important; }
  .auth-divider { margin: .875rem 0; }
}
@media (max-width: 360px) {
  .auth-card { padding: 1.25rem .875rem; }
  .auth-logo-text { font-size: 1.05rem; }
}
