/* ============================================================
   AXVPN – Login Page Styles
   Design: Dark Secure Minimal | Violet + Slate
   ============================================================ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    /* Colors */
    --bg-base:        #0b0b12;
    --bg-surface:     #111119;
    --bg-card:        rgba(14, 14, 26, 0.85);
    --bg-field:       rgba(255, 255, 255, 0.04);
    --bg-field-focus: rgba(124, 58, 237, 0.08);

    --violet-900:     #3b0764;
    --violet-700:     #6d28d9;
    --violet-600:     #7c3aed;
    --violet-500:     #8b5cf6;
    --violet-400:     #a78bfa;
    --violet-300:     #c4b5fd;
    --violet-100:     rgba(167, 139, 250, 0.08);

    --slate-700:      #334155;
    --slate-600:      #475569;
    --slate-500:      #64748b;
    --slate-400:      #94a3b8;
    --slate-300:      #cbd5e1;
    --slate-200:      #e2e8f0;

    --red-400:        #f87171;
    --red-bg:         rgba(248, 113, 113, 0.08);
    --red-border:     rgba(248, 113, 113, 0.2);

    --text-primary:   #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    --border:         rgba(255, 255, 255, 0.07);
    --border-focus:   rgba(124, 58, 237, 0.5);

    /* Glow */
    --glow-violet:    rgba(109, 40, 217, 0.15);
    --glow-indigo:    rgba(79, 70, 229, 0.1);

    /* Spacing */
    --sp-xs:   6px;
    --sp-sm:   12px;
    --sp-md:   20px;
    --sp-lg:   28px;
    --sp-xl:   40px;

    /* Radii */
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  24px;

    /* Fonts */
    --font-display: 'Montserrat', sans-serif;
    --font-body:    'Inter', sans-serif;

    /* Transitions */
    --t-fast:   150ms ease;
    --t-med:    250ms ease;
    --t-slow:   400ms ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Base ───────────────────────────────────────────────────── */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    background: #0d0d14;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* ── Background (solid) ─────────────────────────────────────── */
.bg-grid, .bg-glow, .bg-glow--1, .bg-glow--2, .bg-glow--3 { display: none; }

/* ── Main ───────────────────────────────────────────────────── */
.main {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: var(--sp-md);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Card ───────────────────────────────────────────────────── */
.card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-xl) var(--sp-xl);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 4px 6px rgba(0,0,0,0.3),
        0 20px 60px rgba(0,0,0,0.5),
        0 0 80px rgba(109, 40, 217, 0.06);
    animation: card-appear 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Brand ──────────────────────────────────────────────────── */
.brand {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-lg);
    animation: fade-up 0.5s 0.1s ease both;
}

.brand__icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(109,40,217,0.25), rgba(79,70,229,0.15));
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(109,40,217,0.2), 0 0 0 1px rgba(167,139,250,0.1) inset;
}

.brand__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}

.brand__accent {
    color: var(--violet-400);
}

.brand__tagline {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ── Card Header ────────────────────────────────────────────── */
.card__header {
    margin-bottom: var(--sp-lg);
    animation: fade-up 0.5s 0.15s ease both;
}

.card__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.card__subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── Alert ──────────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-xs);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: var(--sp-md);
    animation: shake 0.4s ease;
}

.alert--error {
    background: var(--red-bg);
    border: 1px solid var(--red-border);
    color: var(--red-400);
}

.alert__icon {
    flex-shrink: 0;
    margin-top: 1px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* ── Form ───────────────────────────────────────────────────── */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
    animation: fade-up 0.5s 0.2s ease both;
}

/* ── Field ──────────────────────────────────────────────────── */
.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field__label {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--slate-400);
    text-transform: uppercase;
}

.field__wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.field__icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color var(--t-med);
}

.field__input {
    width: 100%;
    background: var(--bg-field);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 13px 14px 13px 44px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 400;
    outline: none;
    transition:
        border-color var(--t-med),
        background var(--t-med),
        box-shadow var(--t-med);
    appearance: none;
    -webkit-appearance: none;
}

.field__input--password {
    padding-right: 46px;
}

.field__input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.field__input:focus {
    border-color: var(--border-focus);
    background: var(--bg-field-focus);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.field__input:focus + .field__icon,
.field__wrapper:focus-within .field__icon {
    color: var(--violet-400);
}

.field__input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Password toggle */
.field__toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--t-fast);
}

.field__toggle:hover {
    color: var(--violet-400);
}

/* Password toggle – ikony oka */
.eye-icon { display: block; flex-shrink: 0; }
.eye-icon--hide { display: none; }

/* Gdy button ma klasę .is-visible – zamień ikony */
.field__toggle.is-visible .eye-icon--show { display: none; }
.field__toggle.is-visible .eye-icon--hide { display: block; }

/* ── Attempts Warning ───────────────────────────────────────── */
.attempts-warning {
    font-size: 0.76rem;
    color: var(--slate-500);
    text-align: center;
    margin-top: -4px;
}

.attempts-warning strong {
    color: #fbbf24;
}

/* ── Submit Button ──────────────────────────────────────────── */
.btn-submit {
    position: relative;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--violet-700) 0%, #4f46e5 100%);
    border: 1px solid rgba(124, 58, 237, 0.4);
    border-radius: var(--r-sm);
    color: #fff;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    overflow: hidden;
    transition:
        transform var(--t-fast),
        box-shadow var(--t-med),
        opacity var(--t-fast);
    box-shadow:
        0 4px 15px rgba(109, 40, 217, 0.3),
        0 0 0 1px rgba(255,255,255,0.05) inset;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent 60%);
    opacity: 0;
    transition: opacity var(--t-med);
}

.btn-submit:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 6px 25px rgba(109, 40, 217, 0.45),
        0 0 0 1px rgba(255,255,255,0.05) inset;
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit__spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

.btn-submit__arrow {
    flex-shrink: 0;
    transition: transform var(--t-med);
}

.btn-submit:hover:not(:disabled) .btn-submit__arrow {
    transform: translateX(3px);
}

.btn-submit.loading .btn-submit__text  { display: none; }
.btn-submit.loading .btn-submit__arrow { display: none; }
.btn-submit.loading .btn-submit__spinner { display: block; }

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

/* ── Card Footer (removed) ──────────────────────────────────── */
.card__footer { display: none; }

/* ── Site Footer – fixed at bottom ──────────────────────────── */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0 0 20px;
    z-index: 20;
    pointer-events: none;
}

.site-footer__inner {
    pointer-events: all;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 20px;
    background: rgba(13, 13, 20, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 99px;
    font-size: 0.69rem;
    font-weight: 500;
    color: rgba(100, 116, 139, 0.55);
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(124, 58, 237, 0.0) inset;
    transition: border-color 250ms ease,
                background 250ms ease,
                box-shadow 250ms ease;
    position: relative;
    overflow: hidden;
}

/* Linia dekoracyjna na górze */
.site-footer__inner::before {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(124, 58, 237, 0.4),
        transparent);
}

.site-footer__inner:hover {
    border-color: rgba(124, 58, 237, 0.18);
    background: rgba(13, 13, 20, 0.92);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5),
                0 0 16px rgba(124, 58, 237, 0.06);
    color: rgba(148, 163, 184, 0.7);
}

.site-footer__lock {
    color: rgba(124, 58, 237, 0.5);
    flex-shrink: 0;
}

.site-footer__author {
    color: rgba(167, 139, 250, 0.6);
    font-weight: 600;
}

.site-footer__dot {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.3);
    flex-shrink: 0;
}

/* ── Version Badge (replaced by footer) ────────────────────── */
.version-badge { display: none; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-700); border-radius: 3px; }

/* ── Selection ──────────────────────────────────────────────── */
::selection {
    background: rgba(124, 58, 237, 0.3);
    color: var(--text-primary);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .card {
        padding: var(--sp-lg) var(--sp-md);
        border-radius: var(--r-lg);
    }

    .card__title {
        font-size: 1.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Focus visible (accessibility) ─────────────────────────── */
:focus-visible {
    outline: 2px solid var(--violet-500);
    outline-offset: 2px;
}
