@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-base: #070a12;
    --bg-surface: #0e1526;
    --bg-card: rgba(16, 24, 43, 0.75);
    --bg-input: #0b111e;
    
    --border-subtle: rgba(56, 189, 248, 0.12);
    --border-active: #0ea5e9;
    --border-glow: rgba(14, 165, 233, 0.35);

    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --shadow-card: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 30px rgba(6, 182, 212, 0.08);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: 1.5rem;
}

/* Tło z siatką i promieniami */
.cyber-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(circle at 50% 10%, rgba(14, 165, 233, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    z-index: -1;
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 460px;
    perspective: 1000px;
}

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 1.25rem;
    padding: 2.25rem;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-emerald), transparent);
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    margin-bottom: 1.25rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.brand-title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-cyan);
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.75rem;
}

/* Zakładki metod logowania */
.auth-tabs {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 0.75rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    gap: 0.25rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 0.6rem 0.5rem;
    font-size: 0.825rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Sekcja Passkeys */
.passkey-box {
    text-align: center;
    padding: 1rem 0;
}

.biometric-hero {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0.5rem auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.biometric-halo {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(6, 182, 212, 0.4);
    animation: rotateHalo 12s linear infinite;
}

.biometric-core {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, rgba(14, 165, 233, 0.05) 70%);
    border: 1px solid var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.biometric-hero:hover .biometric-core {
    transform: scale(1.06);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.5);
    color: #fff;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.4) 0%, rgba(14, 165, 233, 0.1) 70%);
}

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

.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 1px solid #38bdf8;
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.925rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #0284c7);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Pola formularza */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 0.65rem;
    padding: 0.75rem 1rem;
    color: #fff;
    font-size: 0.925rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px var(--border-glow);
}

.honeypot-field {
    display: none !important;
    visibility: hidden !important;
    position: absolute;
    left: -9999px;
}

/* Komunikaty błędów i alertów */
.alert-box {
    border-radius: 0.65rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    display: none;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.4;
}

.alert-box.error {
    display: flex;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

.alert-box.success {
    display: flex;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-box.warning {
    display: flex;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

/* Stopka certyfikacji i standardów */
.security-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.spec-badge {
    font-family: var(--font-mono);
    font-size: 0.675rem;
    color: var(--text-dim);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Modal i kody ratunkowe */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.codes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    background: var(--bg-base);
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-cyan);
    margin: 1rem 0;
}
