/**
 * CRIMIFY - Páginas de Autenticação (Login/Registro)
 * Design misterioso e animado com tema detetive
 */

/* ========================================
   IMPORTS & VARIABLES
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
    /* Paleta Dark Misteriosa */
    --bg-deep: #050505;
    --bg-dark: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #151515;
    --bg-card-hover: #1a1a1a;
    
    /* Vermelho Principal */
    --red-primary: #8b0000;
    --red-dark: #5a0000;
    --red-light: #b00000;
    --red-glow: rgba(139, 0, 0, 0.4);
    --red-glow-strong: rgba(139, 0, 0, 0.6);
    
    /* Textos */
    --text-primary: #f5f5f5;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    /* Bordas */
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(139, 0, 0, 0.25);
    
    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.7);
    --shadow-red: 0 0 30px var(--red-glow);
}

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    min-height: 100vh;
}

/* Film Grain Effect */
body.auth-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    animation: grain 8s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-5%, -10%); }
    20% { transform: translate(-15%, 5%); }
    30% { transform: translate(7%, -25%); }
    40% { transform: translate(-5%, 25%); }
    50% { transform: translate(-15%, 10%); }
    60% { transform: translate(15%, 0%); }
    70% { transform: translate(0%, 15%); }
    80% { transform: translate(3%, 35%); }
    90% { transform: translate(-10%, 10%); }
}

/* Background Pattern */
body.auth-page::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 0, 0, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 0, 0, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-dark) 100%);
    pointer-events: none;
    z-index: 0;
}

/* ========================================
   HEADER
   ======================================== */
.auth-page .header {
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
    position: relative;
    z-index: 100;
}

.auth-page .header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-page .logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--red-primary);
    text-decoration: none;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px var(--red-glow);
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-page .logo img {
    height: 36px;
    width: 36px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px var(--red-glow));
}

.auth-page .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--red-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--red-glow);
    position: relative;
}

.auth-page .logo-icon::before {
    content: '🔍';
    font-size: 20px;
}

.auth-page .logo:hover {
    color: var(--red-light);
    text-shadow: 0 0 15px var(--red-glow-strong);
}

.auth-page .logo:hover img {
    filter: drop-shadow(0 0 12px var(--red-glow-strong));
    transform: scale(1.1);
}

.auth-page .logo:hover .logo-icon {
    box-shadow: 0 0 25px var(--red-glow-strong);
    transform: scale(1.1);
}

.auth-page .nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.auth-page .nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.auth-page .nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red-primary);
    box-shadow: 0 0 8px var(--red-glow);
    transition: width 0.3s ease;
}

.auth-page .nav a:hover {
    color: var(--text-primary);
}

.auth-page .nav a:hover::after {
    width: 100%;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.auth-page main {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    position: relative;
    z-index: 2;
}

/* ========================================
   AUTH CARD (Container Principal)
   ======================================== */
.auth-card {
    background: rgba(21, 21, 21, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 40px rgba(0, 0, 0, 0.2),
        0 0 60px rgba(139, 0, 0, 0.1);
    animation: cardAppear 0.8s ease-out;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(139, 0, 0, 0.05) 0%, transparent 50%),
        linear-gradient(225deg, rgba(139, 0, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.auth-card::after {
    content: 'CLASSIFIED';
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 900;
    color: rgba(139, 0, 0, 0.15);
    letter-spacing: 4px;
    transform: rotate(-15deg);
    z-index: 0;
    pointer-events: none;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card-content {
    position: relative;
    z-index: 1;
}

/* ========================================
   TITLE
   ======================================== */
.auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 36px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -1px;
    text-transform: uppercase;
    position: relative;
    animation: titleAppear 0.8s ease-out 0.2s both;
}

.auth-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--red-primary);
    box-shadow: 0 0 15px var(--red-glow);
    border-radius: 2px;
}

@keyframes titleAppear {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   ERROR MESSAGE
   ======================================== */
.auth-error {
    background: rgba(139, 0, 0, 0.15);
    border: 1.5px solid var(--red-primary);
    color: var(--red-light);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    animation: errorShake 0.5s ease-out;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.2);
}

.auth-error::before {
    content: '⚠';
    margin-right: 8px;
    font-size: 16px;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ========================================
   FORM
   ======================================== */
.auth-form {
    margin-top: 32px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
    animation: formGroupAppear 0.6s ease-out both;
}

.form-group:nth-child(1) { animation-delay: 0.3s; }
.form-group:nth-child(2) { animation-delay: 0.4s; }
.form-group:nth-child(3) { animation-delay: 0.5s; }
.form-group:nth-child(4) { animation-delay: 0.6s; }
.form-group:nth-child(5) { animation-delay: 0.7s; }

@keyframes formGroupAppear {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    position: relative;
}

.form-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 30px;
    height: 1px;
    background: var(--red-primary);
    box-shadow: 0 0 8px var(--red-glow);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(10, 10, 10, 0.6);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    position: relative;
}

.form-input:focus {
    outline: none;
    border-color: var(--red-primary);
    background: rgba(10, 10, 10, 0.8);
    box-shadow: 
        0 0 0 3px rgba(139, 0, 0, 0.1),
        0 0 20px rgba(139, 0, 0, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.form-input:focus::placeholder {
    opacity: 0.3;
}

/* Input Icon Effect */
.form-group::before {
    content: '';
    position: absolute;
    right: 16px;
    top: 42px;
    width: 20px;
    height: 20px;
    background: var(--red-primary);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    box-shadow: 0 0 10px var(--red-glow);
}

.form-input:focus ~ .form-group::before,
.form-group:focus-within::before {
    opacity: 0.3;
    transform: scale(1);
}

/* ========================================
   SUBMIT BUTTON
   ======================================== */
.auth-submit {
    width: 100%;
    padding: 16px;
    background: var(--red-primary);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: 
        0 4px 20px var(--red-glow),
        inset 0 0 20px rgba(139, 0, 0, 0.2);
    animation: buttonAppear 0.8s ease-out 0.8s both;
}

.auth-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.auth-submit:hover {
    background: var(--red-light);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 30px var(--red-glow-strong),
        inset 0 0 30px rgba(139, 0, 0, 0.3);
}

.auth-submit:hover::before {
    width: 300px;
    height: 300px;
}

.auth-submit:active {
    transform: translateY(0);
}

@keyframes buttonAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   FOOTER LINK
   ======================================== */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    animation: footerAppear 0.8s ease-out 1s both;
}

.auth-footer a {
    color: var(--red-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    text-shadow: 0 0 10px var(--red-glow);
}

.auth-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--red-primary);
    box-shadow: 0 0 8px var(--red-glow);
    transition: width 0.3s ease;
}

.auth-footer a:hover {
    color: var(--red-light);
    text-shadow: 0 0 15px var(--red-glow-strong);
}

.auth-footer a:hover::after {
    width: 100%;
}

@keyframes footerAppear {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   DECORATIVE ELEMENTS
   ======================================== */
.auth-card .decoration {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.auth-card .decoration-1 {
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border: 2px solid rgba(139, 0, 0, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.auth-card .decoration-2 {
    bottom: -30px;
    left: -30px;
    width: 150px;
    height: 150px;
    border: 2px solid rgba(139, 0, 0, 0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .auth-card {
        padding: 40px 28px;
        max-width: 100%;
    }

    .auth-title {
        font-size: 28px;
    }

    .auth-page .header-content {
        padding: 0 20px;
    }

    .auth-page .nav {
        gap: 16px;
    }

    .auth-page .nav a {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
        border-radius: 12px;
    }

    .auth-title {
        font-size: 24px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .auth-submit {
        padding: 14px;
        font-size: 14px;
    }
}

/* ========================================
   REDUCE MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body.auth-page::before {
        animation: none;
    }
}

