/* ================================================================
   FlowQuadras — Base Stylesheet (Global)
   Carregado em TODAS as páginas do sistema.
   Contém: tokens, reset, estilos de base e estilos da página de login.
   ================================================================ */

/* ── Tokens centralizados ── */
@import url('../components/theme.css');

/* ── Animações ── */
@import url('../components/animations.css');

/* ════════════════════════════════════════════════
   RESET
════════════════════════════════════════════════ */

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

html, body { height: 100%; }

body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--color-primary-hover); }

/* ════════════════════════════════════════════════
   PÁGINA DE LOGIN — Layout
════════════════════════════════════════════════ */

.login-page {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--space-lg);
    overflow: hidden;
    /* Gradiente ambiental sutil — sem grid sci-fi */
    background:
        radial-gradient(ellipse 60% 50% at 15% 10%, rgba(46, 201, 138, 0.09) 0%, transparent 100%),
        radial-gradient(ellipse 50% 50% at 85% 85%, rgba(232, 145, 74, 0.07) 0%, transparent 100%),
        var(--color-bg);
}

/* SVG de fundo: linhas de quadra se desenhando */
.court-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.28;
    pointer-events: none;
    z-index: 0;
}

.court-line {
    stroke: var(--color-primary);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: draw-court 2.4s ease-out forwards;
}

.court-line:nth-child(1) { animation-delay: 0.00s; }
.court-line:nth-child(2) { animation-delay: 0.15s; }
.court-line:nth-child(3) { animation-delay: 0.30s; }
.court-line:nth-child(4) { animation-delay: 0.40s; }
.court-line:nth-child(5) { animation-delay: 0.50s; }
.court-line:nth-child(6) { animation-delay: 0.60s; }
.court-line:nth-child(7) { animation-delay: 0.70s; }
.court-line:nth-child(8) { animation-delay: 0.80s; }

/* ════════════════════════════════════════════════
   LOGIN — Card principal
════════════════════════════════════════════════ */

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-top: 2px solid var(--color-primary);        /* Acento de borda superior */
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-xl) var(--space-lg);
    box-shadow: var(--shadow-lg);
    animation: card-in 0.50s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ════════════════════════════════════════════════
   LOGIN — Marca / Brand
════════════════════════════════════════════════ */

.login-brand {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.brand-icon {
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-md);
}

.brand-icon .ball {
    stroke: var(--color-primary);
    stroke-width: 2;
    fill: var(--color-primary-soft);
    animation: ball-pop 0.70s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transform-origin: center;
}

.brand-icon .ball-line {
    stroke: var(--color-primary);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: draw-line 0.9s ease-out 0.25s forwards;
}

.brand-icon .ball-line:nth-child(2) { animation-delay: 0.35s; }
.brand-icon .ball-line:nth-child(3) { animation-delay: 0.45s; }
.brand-icon .ball-line:nth-child(4) { animation-delay: 0.55s; }

.login-brand h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--color-text);
}

.brand-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    letter-spacing: 0.02em;
}

/* ════════════════════════════════════════════════
   LOGIN — Formulário
════════════════════════════════════════════════ */

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.field label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-soft);
    letter-spacing: 0.01em;
}

.field input {
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.875rem;
    width: 100%;
    transition:
        border-color var(--transition-fast),
        box-shadow   var(--transition-fast),
        background   var(--transition-fast);
}

.field input::placeholder { color: var(--color-text-muted); }

.field input:hover  { border-color: rgba(58, 128, 85, 0.50); }

.field input:focus {
    outline: none;
    background: var(--color-surface-2, var(--color-bg));
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

/* ════════════════════════════════════════════════
   BOTÃO PRIMÁRIO — base global
════════════════════════════════════════════════ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #0a1810;              /* Texto escuro sobre verde — melhor contraste */
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    padding: 0.8125rem 1.25rem;
    cursor: pointer;
    margin-top: var(--space-sm);
    transition:
        background   var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow   var(--transition-fast),
        transform    var(--transition-fast);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    box-shadow: 0 6px 20px rgba(46, 201, 138, 0.28);
}

.btn-primary:active  { transform: translateY(1px); }

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.btn-arrow { transition: transform var(--transition-base); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }

/* ════════════════════════════════════════════════
   LOGIN — Mensagem de erro
════════════════════════════════════════════════ */

.message {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    animation: shake-in 0.4s ease-out both;
}

.message.error {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border: 1px solid rgba(223, 92, 82, 0.22);
}

.message svg { flex-shrink: 0; }

/* ════════════════════════════════════════════════
   LOGIN — Rodapé do card
════════════════════════════════════════════════ */

.login-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.login-footer a {
    font-weight: 600;
    margin-left: var(--space-xs);
    color: var(--color-primary);
}

.login-footer a:hover { color: var(--color-primary-hover); }

/* ════════════════════════════════════════════════
   RESPONSIVO
════════════════════════════════════════════════ */

@media (max-width: 420px) {
    .login-card {
        padding: var(--space-lg);
        border-radius: var(--radius-md);
    }

    .court-bg { opacity: 0.18; }
}