/**
 * ==========================================================================
 * FENAJUD — Estilos de Autenticação (Premium Dark UI)
 * ==========================================================================
 *
 * Design premium com glassmorphism, gradientes animados e micro-interações.
 * Standalone — não depende de style.css (layout: false).
 *
 * @version 3.0.0
 */


/* ─────────────────────────────────────────────────────────────────────────────
   TOKENS DE DESIGN
   ───────────────────────────────────────────────────────────────────────────── */

:root {
    --auth-bg: #06080f;
    --auth-surface: rgba(17, 24, 39, 0.55);
    --auth-surface-border: rgba(255, 255, 255, 0.06);
    --auth-glass: rgba(255, 255, 255, 0.03);
    --auth-primary: #E31E24;
    --auth-primary-hover: #2563eb;
    --auth-primary-glow: rgba(227, 30, 36, 0.35);
    --auth-secondary: #B31015;
    --auth-text: #f1f5f9;
    --auth-text-muted: #94a3b8;
    --auth-text-faint: rgba(255, 255, 255, 0.3);
    --auth-danger: #ef4444;
    --auth-radius: 16px;
    --auth-radius-sm: 12px;
    --auth-font: 'Inter', system-ui, -apple-system, sans-serif;
    --auth-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ─────────────────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

body.auth-page {
    font-family: var(--auth-font);
    background: var(--auth-bg);
    color: var(--auth-text);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    position: relative;
}


/* ─────────────────────────────────────────────────────────────────────────────
   BACKGROUND ANIMADO
   ───────────────────────────────────────────────────────────────────────────── */

.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: auth-float 20s ease-in-out infinite;
}

.auth-bg__orb--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(227, 30, 36, 0.3), transparent 70%);
    top: -20%;
    left: -10%;
    animation-duration: 25s;
}

.auth-bg__orb--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(179, 16, 21, 0.25), transparent 70%);
    bottom: -15%;
    right: -5%;
    animation-duration: 30s;
    animation-delay: -5s;
}

.auth-bg__orb--3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 22s;
    animation-delay: -10s;
}

.auth-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes auth-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(20px, 20px) scale(1.02); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   WRAPPER SPLIT-LAYOUT
   ───────────────────────────────────────────────────────────────────────────── */

.auth-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    min-height: 100vh;
}


/* ─────────────────────────────────────────────────────────────────────────────
   HERO PANEL (ESQUERDA)
   ───────────────────────────────────────────────────────────────────────────── */

.auth-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 4rem;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(59,130,246,0.08) 0%, transparent 50%),
        linear-gradient(225deg, rgba(139,92,246,0.06) 0%, transparent 50%);
}

.auth-hero__content {
    position: relative;
    z-index: 2;
    max-width: 420px;
}

.auth-hero__icon {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    box-shadow: 0 16px 40px rgba(227, 30, 36, 0.25);
    animation: auth-pulse-glow 4s ease-in-out infinite;
}

.auth-hero__icon ion-icon {
    font-size: 36px;
    color: #fff;
}

.auth-hero__title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--auth-text);
    line-height: 1.15;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.auth-hero__subtitle {
    font-size: 1.05rem;
    color: var(--auth-text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.auth-hero__features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-hero__feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-glass);
    border: 1px solid var(--auth-surface-border);
    backdrop-filter: blur(10px);
    transition: all var(--auth-transition);
}

.auth-hero__feature:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.auth-hero__feature ion-icon {
    font-size: 22px;
    color: var(--auth-primary);
    flex-shrink: 0;
}

.auth-hero__feature span {
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    font-weight: 500;
}

/* Elementos flutuantes decorativos */
.auth-hero__float {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.04);
    animation: auth-float-element 15s ease-in-out infinite;
}

.auth-hero__float--1 {
    width: 200px;
    height: 200px;
    top: 10%;
    right: 5%;
    background: radial-gradient(circle, rgba(59,130,246,0.05), transparent 70%);
    animation-duration: 20s;
}

.auth-hero__float--2 {
    width: 120px;
    height: 120px;
    bottom: 15%;
    left: 10%;
    background: radial-gradient(circle, rgba(139,92,246,0.06), transparent 70%);
    animation-delay: -7s;
}

.auth-hero__float--3 {
    width: 80px;
    height: 80px;
    top: 60%;
    right: 20%;
    background: radial-gradient(circle, rgba(16,185,129,0.06), transparent 70%);
    animation-delay: -12s;
    animation-duration: 18s;
}

@keyframes auth-float-element {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(10px) rotate(-3deg); }
}

@keyframes auth-pulse-glow {
    0%, 100% { box-shadow: 0 16px 40px rgba(227, 30, 36, 0.25); }
    50% { box-shadow: 0 16px 50px rgba(227, 30, 36, 0.4); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   LOGIN PANEL (DIREITA)
   ───────────────────────────────────────────────────────────────────────────── */

.auth-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    position: relative;
    border-left: 1px solid var(--auth-surface-border);
    background:
        linear-gradient(180deg, rgba(17,24,39,0.4) 0%, rgba(6,8,15,0.8) 100%);
}


/* ─────────────────────────────────────────────────────────────────────────────
   LOGIN CARD (GLASSMORPHISM)
   ───────────────────────────────────────────────────────────────────────────── */

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2.75rem;
    border-radius: var(--auth-radius);
    background: var(--auth-surface);
    border: 1px solid var(--auth-surface-border);
    backdrop-filter: blur(20px);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    animation: auth-card-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes auth-card-enter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ── Logo/Título ── */

.auth-card__logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card__logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 24px var(--auth-primary-glow);
    position: relative;
}

.auth-card__logo-icon::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 22px;
    border: 1px solid rgba(227, 30, 36, 0.15);
    animation: auth-pulse-ring 3s ease-in-out infinite;
}

@keyframes auth-pulse-ring {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0; transform: scale(1.15); }
}

.auth-card__logo-icon ion-icon {
    font-size: 28px;
    color: #fff;
}

.auth-card__title {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    margin-bottom: 0.35rem;
}

.auth-card__desc {
    font-size: 0.88rem;
    color: var(--auth-text-muted);
}


/* ── Erro ── */

.auth-card__error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--auth-radius-sm);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    animation: auth-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.auth-card__error ion-icon {
    font-size: 20px;
    color: var(--auth-danger);
    flex-shrink: 0;
}

@keyframes auth-shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}


/* ── Formulário ── */

.auth-card__form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}


/* ─────────────────────────────────────────────────────────────────────────────
   CAMPOS COM ÍCONES E LABELS FLUTUANTES
   ───────────────────────────────────────────────────────────────────────────── */

.auth-field {
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--auth-radius-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 64px;
    padding: 0 4px;
    backdrop-filter: blur(5px);
}

.auth-field:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.6);
}

.auth-field:focus-within {
    border-color: var(--auth-primary);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 
        0 0 0 4px rgba(227, 30, 36, 0.1),
        0 10px 20px -10px rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

.auth-field__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    flex-shrink: 0;
    height: 32px;
    margin: 0;
    transition: all 0.3s ease;
}

.auth-field__icon ion-icon {
    font-size: 22px;
    color: var(--auth-text-faint);
    transition: all 0.3s ease;
}

.auth-field:focus-within .auth-field__icon ion-icon {
    color: var(--auth-primary);
    transform: scale(1.1);
}

.auth-field__input-wrapper {
    position: relative;
    flex: 1;
    padding-right: 8px;
}

.auth-field__input-wrapper input {
    width: 100%;
    padding: 24px 8px 8px;
    background: none;
    border: none;
    color: var(--auth-text);
    font-size: 1rem;
    font-weight: 500;
    font-family: var(--auth-font);
    outline: none;
    letter-spacing: 0.3px;
}

.auth-field__input-wrapper input::placeholder {
    color: transparent;
}

.auth-field__input-wrapper label {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--auth-text-muted);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
}

/* Label flutua para cima quando input tem foco ou valor */
.auth-field__input-wrapper input:focus + label,
.auth-field__input-wrapper input:not(:placeholder-shown) + label {
    top: 12px;
    transform: translateY(0);
    font-size: 0.7rem;
    color: var(--auth-primary);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Toggle de senha */
.auth-field__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    color: var(--auth-text-faint);
    flex-shrink: 0;
    transition: all var(--auth-transition);
}

.auth-field__toggle:hover {
    color: var(--auth-text-muted);
    background: rgba(255, 255, 255, 0.04);
}

.auth-field__toggle ion-icon {
    font-size: 20px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   BOTÃO SUBMIT (PREMIUM)
   ───────────────────────────────────────────────────────────────────────────── */

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    margin-top: 0.75rem;
    border: none;
    border-radius: var(--auth-radius-sm);
    background: linear-gradient(135deg, var(--auth-primary), #1d4ed8);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--auth-font);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--auth-transition);
    box-shadow: 0 8px 24px var(--auth-primary-glow);
    min-height: 52px;
}

.auth-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px var(--auth-primary-glow);
}

.auth-submit:hover::before {
    transform: translateX(100%);
}

.auth-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px var(--auth-primary-glow);
}

.auth-submit__icon {
    font-size: 18px;
    transition: transform var(--auth-transition);
}

.auth-submit:hover .auth-submit__icon {
    transform: translateX(3px);
}

.auth-submit--loading {
    opacity: 0.85;
    pointer-events: none;
}

.auth-submit__loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}


/* ─────────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────────── */

.auth-card__footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-surface-border);
    font-size: 0.85rem;
    color: var(--auth-text-muted);
}

.auth-card__footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--auth-transition);
    margin-left: 4px;
}

.auth-card__footer a:hover {
    color: #60a5fa;
    text-decoration: underline;
}


/* ── Marca d'água ── */

.auth-watermark {
    position: absolute;
    bottom: 1.5rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
}


/* ─────────────────────────────────────────────────────────────────────────────
   REGISTRO (CONTAINER WIDE)
   ───────────────────────────────────────────────────────────────────────────── */

/* Mantém compatibilidade com o registro existente */
.auth-container {
    background-color: rgba(17, 24, 39, 0.55);
    padding: 2.5rem;
    border-radius: var(--auth-radius);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--auth-surface-border);
    backdrop-filter: blur(20px);
}

.auth-container--wide {
    max-width: 500px;
}

.auth-title {
    color: var(--auth-primary);
    margin-bottom: 2rem;
}

.auth-subtitle {
    color: var(--auth-text);
    margin-bottom: 2rem;
    text-align: center;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-field--full {
    grid-column: span 2;
}

.auth-card--register {
    max-width: 650px;
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--auth-text-muted);
}

.auth-footer a {
    color: var(--auth-primary);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-error {
    background-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}


/* ─────────────────────────────────────────────────────────────────────────────
   RESPONSIVIDADE
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .auth-hero {
        display: none;
    }

    .auth-panel {
        width: 100%;
        border-left: none;
        padding: 2rem;
    }

    .auth-card {
        max-width: 440px;
    }
}

@media (max-width: 600px) {
    .auth-panel {
        padding: 1.25rem;
        justify-content: flex-start;
        padding-top: 15vh;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 14px;
        max-width: 100%;
    }

    .auth-card__title {
        font-size: 1.5rem;
    }

    .auth-card__logo-icon {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    .auth-card__logo-icon ion-icon {
        font-size: 24px;
    }

    .auth-field {
        min-height: 56px;
    }

    .auth-field__input-wrapper input {
        font-size: 1rem;
    }

    .auth-submit {
        min-height: 50px;
        font-size: 1rem;
    }

    .auth-container,
    .auth-container--wide {
        margin: 1rem;
        padding: 1.5rem;
    }

    .auth-form-grid {
        grid-template-columns: 1fr;
    }
}


/* ─────────────────────────────────────────────────────────────────────────────
   ACESSIBILIDADE
   ───────────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .auth-bg__orb,
    .auth-hero__float,
    .auth-card__logo-icon::after,
    .auth-hero__icon {
        animation: none;
    }

    .auth-card {
        animation: none;
    }

    .auth-submit::before {
        transition: none;
    }
}

@media (prefers-contrast: high) {
    .auth-field {
        border-color: rgba(255, 255, 255, 0.3);
    }

    .auth-card {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(17, 24, 39, 0.85);
    }

    .auth-card__error {
        border-color: rgba(239, 68, 68, 0.5);
    }
}
