/* ==========================================================================
   login.css  —  tela de acesso (tema dark, accent cyan)
   Escopo total sob .auth-page: nao interfere no restante da aplicacao.
   ========================================================================== */

/* ===== Tema dark â€” paleta do Exemplos/htdocs (accent cyan) ===== */
.auth-page {
    --bg-body: #060A12;
    --bg-surface: #0B1120;
    --bg-raised: #101929;
    --bg-card: #0D1525;
    --bg-inset: #060A12;
    --border: #1C2B40;
    --border-subtle: rgba(255,255,255,0.05);
    --text: #EFF4FF;
    --text-secondary: #8899B4;
    --text-muted: #4A5F7A;
    --primary: #3B82F6;
    --primary-bg: rgba(59,130,246,0.10);
    --primary-text: #93C5FD;
    --a: #00D4FF;
    --a2: #0099CC;
    --a3: rgba(0,212,255,0.12);
    --a-text: #7EE8FF;
    --a-glow: 0 0 40px rgba(0,212,255,0.2);
    --a-ring: rgba(0,212,255,0.25);
    --a-gradient: linear-gradient(135deg, #00D4FF, #0099CC);
    --danger: #FF3D5A;
    --danger-dim: rgba(255,61,90,0.12);
    --danger-text: #FCA5A5;
    --success: #00E676;
    --success-dim: rgba(0,230,118,0.12);
    --shadow-lg: 0 12px 48px rgba(0,0,0,0.7);
}

.auth-page,
.auth-page * {
    box-sizing: border-box;
}

.auth-page {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    overflow: hidden;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
}

/* Radial background glows (accent cyan) */
.auth-page .auth-bg-radial {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0,212,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(59,130,246,0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* Animated grid */
.auth-page .auth-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,212,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,212,255,0.05) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: authGrid 20s linear infinite;
    pointer-events: none;
}

@@keyframes authGrid {
    0% { background-position: 0 0; }
    100% { background-position: 60px 60px; }
}

/* Diagonal scan lines */
.auth-page .auth-bg-scan {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-page .auth-bg-scan span {
    position: absolute;
    width: 200%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0,212,255,.32), transparent);
    left: -50%;
    animation: authScan 8s ease-in-out infinite;
}

.auth-page .auth-bg-scan span:nth-child(1) { top: 38%; }
.auth-page .auth-bg-scan span:nth-child(2) { top: 62%; animation-delay: 4s; opacity: .5; }

@@keyframes authScan {
    0%, 100% { transform: translateX(-100%) rotate(-8deg); }
    50% { transform: translateX(20%) rotate(-8deg); }
}

/* Scanline overlay (igual htdocs) */
.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
    opacity: .4;
}

/* Card */
.auth-card {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    background: rgba(13,21,37,0.85);
    border: 1px solid rgba(0,212,255,0.22);
    border-radius: 16px;
    padding: 40px 36px;
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    box-shadow:
        0 0 60px rgba(0,212,255,0.10),
        var(--shadow-lg);
    overflow: hidden;
    animation: authCardIn .35s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--a), var(--a2), transparent);
    border-radius: 16px 16px 0 0;
}

@@keyframes authCardIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    display: block;
    width: 96px;
    height: auto;
    margin: 0 auto 14px;
    opacity: .95;
    filter: drop-shadow(0 0 12px rgba(0,212,255,0.30));
}

.auth-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--text);
    letter-spacing: -.5px;
    line-height: 1.15;
}

.auth-title em {
    color: var(--a);
    font-style: normal;
    font-weight: 800;
}

.auth-subtitle {
    font-size: .6rem;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 6px;
}

/* Alert */
.auth-alert {
    background: var(--danger-dim);
    color: var(--danger-text);
    border: 1px solid rgba(255,61,90,.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: .76rem;
    margin-bottom: 16px;
    text-align: center;
    line-height: 1.4;
}

.auth-alert .alert-resend-link {
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
    text-decoration: underline;
    color: var(--a-text);
}

.auth-alert .alert-resend-link:hover {
    color: var(--a);
}

/* display:inline-block acima venceria a regra [hidden] do navegador */
.auth-alert[hidden],
.auth-alert .alert-resend-link[hidden] {
    display: none;
}

/* Form */
.auth-field {
    margin-bottom: 14px;
}

.auth-label {
    display: block;
    font-size: .62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,.45);
    margin-bottom: 6px;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-input-wrap:focus-within {
    border-color: var(--a);
    box-shadow: 0 0 0 3px var(--a3);
    background: rgba(16,25,41,0.9);
}

.auth-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 100%;
    color: var(--text-muted);
    flex-shrink: 0;
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: var(--a);
}

.auth-input-icon svg {
    width: 16px;
    height: 16px;
}

.auth-input {
    flex: 1;
    padding: 12px 14px 12px 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: .85rem;
    font-family: inherit;
    width: 100%;
}

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

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-raised) inset;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--text);
}

.auth-toggle-pass {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .2s ease;
    flex-shrink: 0;
}

.auth-toggle-pass:hover {
    color: var(--a);
}

.auth-toggle-pass svg {
    width: 18px;
    height: 18px;
}

/* Row: remember + forgot */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 18px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: .75rem;
    color: var(--text-secondary);
}

.auth-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-raised);
    cursor: pointer;
    position: relative;
    transition: all .2s ease;
    flex-shrink: 0;
}

.auth-check input[type="checkbox"]:checked {
    background: var(--a);
    border-color: var(--a);
}

.auth-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 5px;
    height: 9px;
    border: solid #060A12;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.auth-link {
    font-size: .75rem;
    color: var(--a-text);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s ease;
}

.auth-link:hover {
    color: var(--a);
    text-decoration: underline;
}

/* Button */
.auth-submit {
    width: 100%;
    padding: 13px;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: var(--a-gradient);
    color: #060A12;
    box-shadow: 0 8px 24px var(--a-ring);
    border: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px var(--a-ring), 0 0 30px rgba(0,212,255,0.3);
}

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

.auth-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Extras */
/* Convite ao auto-cadastro, logo abaixo do botão Entrar */
.auth-cadastro {
    margin-top: 16px;
    text-align: center;
    font-size: .8rem;
    color: var(--a-text);
}

.auth-link--destaque {
    font-size: .8rem;
    font-weight: 600;
    color: var(--a);
    margin-left: 4px;
}

.auth-extra {
    margin-top: 18px;
    text-align: center;
    font-size: .72rem;
}

.auth-foot {
    text-align: center;
    margin-top: 22px;
    font-size: .55rem;
    color: rgba(255,255,255,.25);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Responsive */
@@media (max-width: 480px) {
    .auth-card {
        padding: 30px 22px;
        margin: .75rem;
        border-radius: 14px;
    }

    .auth-logo {
        width: 78px;
    }

    .auth-title {
        font-size: 1.25rem;
    }
}
