/* ============================================================
   TELA DE LOGIN — DRIVE DE PROJETOS | ALLAN ARRUDA
   Estilo AbacatePay / Linear / Vercel (Clean & Modular)
   ============================================================ */

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

:root {
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --line: #E2E8F0;
  --line-focus: #1D6FF2;
  
  --tx-main: #0F172A;
  --tx-muted: #475569;
  --tx-dim: #94A3B8;
  
  --primary: #1D6FF2;
  --primary-hover: #155FD6;
  --amber: #F59E0B;
  --green: #16A34A;
  --red: #EF4444;
  
  --f-display: "Fustat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-mono: "Fustat", "Inter", sans-serif;
  
  --r-card: 20px;
  --r-input: 12px;
  --r-btn: 12px;
}

body {
  font-family: var(--f-body);
  background-color: var(--bg-page);
  color: var(--tx-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* FUNDO GEOMÉTRICO MODULAR (GRID & GLOW) */
.login-bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center center;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, #000 40%, transparent 100%);
}

.login-bg-glow {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(circle, rgba(29, 111, 242, 0.08) 0%, rgba(245, 158, 11, 0.04) 50%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

/* CONTAINER PRINCIPAL */
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* CARD DE LOGIN (BENTO CARD BRANCO) */
.login-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 36px 32px;
  box-shadow: 
    0 1px 3px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: cardFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* LOGO E BRAND */
.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 2px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease;
}

.brand-link:hover {
  transform: scale(1.02);
}

.brand-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.brand-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-tag {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-title {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--tx-main);
}

/* HEADER DO CARD */
.card-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--tx-main);
}

.card-subtitle {
  font-size: 13.5px;
  color: var(--tx-muted);
  line-height: 1.5;
}

/* ALERTAS DE FEEDBACK */
.auth-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-alert.error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #B91C1C;
}

.auth-alert.success {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #15803D;
}

/* BOTÃO GOOGLE OAUTH */
.oauth-section {
  width: 100%;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  padding: 12px 16px;
  font-family: var(--f-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tx-main);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-google:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.btn-google:active {
  transform: translateY(0);
}

/* DIVISOR */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-divider span {
  font-size: 12px;
  font-weight: 500;
  color: var(--tx-dim);
  text-transform: lowercase;
}

/* FORMULÁRIO */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx-main);
}

.forgot-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--tx-dim);
  pointer-events: none;
}

.form-input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--tx-main);
  transition: all 0.15s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px rgba(29, 111, 242, 0.15);
}

.form-input::placeholder {
  color: var(--tx-dim);
}

/* BOTÃO DE SUBMIT */
.btn-submit {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--r-btn);
  font-family: var(--f-body);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(29, 111, 242, 0.28);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 4px;
}

.btn-submit:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(29, 111, 242, 0.38);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* TOGGLE MAGIC LINK / SENHA */
.auth-toggle-row {
  display: flex;
  justify-content: center;
}

.btn-toggle-mode {
  background: none;
  border: none;
  color: var(--tx-muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.btn-toggle-mode:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* RODAPÉ DO CARD */
.card-footer {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--tx-muted);
}

.footer-cta-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-cta-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* RODAPÉ EXTERNO */
.login-footer-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--tx-dim);
  text-align: center;
}

.meta-security {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tx-muted);
  font-weight: 500;
}

.meta-copyright {
  font-size: 11.5px;
}

/* RESPONSIVO MOBILE */
@media (max-width: 480px) {
  body {
    padding: 16px 12px;
    justify-content: flex-start;
  }
  .login-card {
    padding: 28px 20px;
    border-radius: 16px;
  }
  .card-title {
    font-size: 21px;
  }
}
