/* ============================================
   AUTH PAGES - Login & Register
   AI Evolution V3
   ============================================ */

:root {
    --bg: #0B0B0C;
    --bg-card: #121214;
    --bg-elevated: #1c1c20;
    --text: #ffffff;
    --text-muted: #a1a1aa;
    --accent: #FFC700;
    --accent-hover: #ffb800;
    --border: #27272a;
    --success: #10b981;
    --error: #ef4444;
    --radius: 12px;
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #151824 0, var(--bg) 55%, #02030a 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2rem 1rem;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 199, 0, 0.03) 0%, transparent 50%);
    animation: body-rotate 30s linear infinite;
    pointer-events: none;
}

@keyframes body-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float-card {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ============================================
   AUTH CONTAINER
   ============================================ */

.auth-container {
    width: 100%;
    max-width: 480px;
    padding: 24px;
}

.auth-card {
    background: linear-gradient(145deg, rgba(18, 18, 20, 0.95), rgba(12, 12, 14, 0.98));
    border: 1px solid rgba(255, 199, 0, 0.2);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 199, 0, 0.08);
    animation: float-card 6s ease-in-out infinite;
    position: relative;
    z-index: 1;
    transition: border-color 0.3s, box-shadow 0.3s;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 2rem;
}

.auth-card:hover {
    border-color: rgba(255, 199, 0, 0.4);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 199, 0, 0.15);
}

/* ============================================
   HEADER
   ============================================ */

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 24px;
}

.logo-icon {
    font-size: 24px;
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 15px;
}

/* ============================================
   FORM
   ============================================ */

.auth-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 199, 0, 0.1);
}

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

.form-hint {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================
   CHECKBOX
   ============================================ */

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox input[type="checkbox"] {
    width: auto;
    margin-top: 4px;
    cursor: pointer;
}

.checkbox span {
    flex: 1;
}

.checkbox a {
    color: var(--accent);
    text-decoration: none;
}

.checkbox a:hover {
    text-decoration: underline;
}

/* ============================================
   FORM FOOTER
   ============================================ */

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.link {
    color: var(--accent);
    text-decoration: none;
}

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

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #ffe066 0%, #FFC700 50%, #ff9500 100%);
    color: #000;
    position: relative;
    overflow: hidden;
    animation: btn-glow-pulse 2s ease-in-out infinite;
}

@keyframes btn-glow-pulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 199, 0, 0.3); }
    50% { box-shadow: 0 6px 25px rgba(255, 199, 0, 0.5); }
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffeb80 0%, #ffce1f 50%, #ffa500 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 199, 0, 0.5);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
    padding: 14px 24px;
}

.loader {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   MESSAGES
   ============================================ */

.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-top: 16px;
    font-size: 14px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
}

.success-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

/* ============================================
   AUTH FOOTER
   ============================================ */

.auth-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    margin-top: 24px;
}

/* Footer at bottom of page */
.footer {
    position: relative;
    width: 100%;
    margin-top: auto;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   DIVIDER
   ============================================ */

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider span {
    padding: 0 16px;
}

/* ============================================
   SOCIAL LOGIN
   ============================================ */

.social-login {
    display: flex;
    gap: 12px;
}

.btn-social {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-social:hover:not(:disabled) {
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.btn-social:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   NEWSLETTER CHECKBOX (ENHANCED)
   ============================================ */

.newsletter-promo {
    margin: 24px 0;
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 199, 0, 0.12) 0%, rgba(255, 199, 0, 0.05) 50%, rgba(255, 199, 0, 0.08) 100%);
    border: 2px solid rgba(255, 199, 0, 0.3);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(255, 199, 0, 0.1), inset 0 0 30px rgba(255, 199, 0, 0.05);
    animation: newsletter-glow 3s ease-in-out infinite;
}

/* INTENSYWNE PODŚWIETLENIE GDY ZAZNACZONY - JAK LASER ŻÓŁTY */
.newsletter-promo:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, rgba(255, 199, 0, 0.4) 0%, rgba(255, 199, 0, 0.3) 50%, rgba(255, 199, 0, 0.35) 100%) !important;
    border: 3px solid #FFC700 !important;
    box-shadow: 
        0 0 30px rgba(255, 199, 0, 0.8),
        0 0 60px rgba(255, 199, 0, 0.6),
        0 0 90px rgba(255, 199, 0, 0.4),
        inset 0 0 50px rgba(255, 199, 0, 0.3) !important;
    animation: newsletter-laser 1.5s ease-in-out infinite !important;
    transform: scale(1.02);
}

@keyframes newsletter-laser {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(255, 199, 0, 0.8),
            0 0 60px rgba(255, 199, 0, 0.6),
            0 0 90px rgba(255, 199, 0, 0.4),
            inset 0 0 50px rgba(255, 199, 0, 0.3);
        border-color: #FFC700;
    }
    50% { 
        box-shadow: 
            0 0 50px rgba(255, 199, 0, 1),
            0 0 100px rgba(255, 199, 0, 0.8),
            0 0 150px rgba(255, 199, 0, 0.6),
            inset 0 0 80px rgba(255, 199, 0, 0.5);
        border-color: #FFD700;
    }
}

@keyframes newsletter-glow {
    0%, 100% { 
        box-shadow: 0 4px 20px rgba(255, 199, 0, 0.1), inset 0 0 30px rgba(255, 199, 0, 0.05);
        border-color: rgba(255, 199, 0, 0.3);
    }
    50% { 
        box-shadow: 0 8px 30px rgba(255, 199, 0, 0.2), inset 0 0 40px rgba(255, 199, 0, 0.1);
        border-color: rgba(255, 199, 0, 0.5);
    }
}

.newsletter-promo::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: newsletter-shine 4s infinite;
}

@keyframes newsletter-shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.newsletter-promo:hover {
    border-color: rgba(255, 199, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 199, 0, 0.18) 0%, rgba(255, 199, 0, 0.08) 50%, rgba(255, 199, 0, 0.12) 100%);
    box-shadow: 0 8px 30px rgba(255, 199, 0, 0.25), inset 0 0 50px rgba(255, 199, 0, 0.15) !important;
    transform: translateY(-2px);
}

.checkbox-newsletter {
    align-items: flex-start !important;
    gap: 16px !important;
    cursor: pointer;
    margin: 0;
    position: relative;
    pointer-events: auto;
    z-index: 1;
}

.checkbox-newsletter input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 24px;
    height: 24px;
    margin: 0;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.checkbox-newsletter:hover .checkbox-custom {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 199, 0, 0.1), 0 4px 12px rgba(255, 199, 0, 0.2);
    transform: scale(1.05);
}

.checkbox-newsletter input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 199, 0, 0.2), 0 4px 16px rgba(255, 199, 0, 0.4);
    transform: scale(1.1);
}

/* CAŁY BLOK ŚWIECI JAK LASER GDY ZAZNACZONY */
.newsletter-promo:has(input[type="checkbox"]:checked) {
    background: linear-gradient(135deg, rgba(255, 199, 0, 0.4) 0%, rgba(255, 199, 0, 0.25) 50%, rgba(255, 199, 0, 0.35) 100%) !important;
    border: 3px solid #FFC700 !important;
    box-shadow: 
        0 0 30px rgba(255, 199, 0, 0.8),
        0 0 60px rgba(255, 199, 0, 0.6),
        0 0 90px rgba(255, 199, 0, 0.4),
        inset 0 0 50px rgba(255, 199, 0, 0.3) !important;
    animation: newsletter-laser 1.5s ease-in-out infinite !important;
    transform: scale(1.02);
}

@keyframes newsletter-laser {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(255, 199, 0, 0.8),
            0 0 60px rgba(255, 199, 0, 0.6),
            0 0 90px rgba(255, 199, 0, 0.4),
            inset 0 0 50px rgba(255, 199, 0, 0.3);
        border-color: #FFC700;
    }
    50% { 
        box-shadow: 
            0 0 50px rgba(255, 199, 0, 1),
            0 0 100px rgba(255, 199, 0, 0.8),
            0 0 150px rgba(255, 199, 0, 0.6),
            inset 0 0 80px rgba(255, 199, 0, 0.5);
        border-color: #FFD700;
    }
}

.checkbox-newsletter input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.checkbox-label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-label strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.checkbox-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    font-weight: 400;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
    .auth-card {
        padding: 32px 24px;
    }
    
    .auth-header h1 {
        font-size: 24px;
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .newsletter-promo {
        padding: 16px;
    }
    
    .checkbox-newsletter {
        gap: 12px !important;
    }
    
    .checkbox-label strong {
        font-size: 14px;
    }
    
    .checkbox-subtitle {
        font-size: 12px;
    }
}
