* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #09090b;
    color: #ffffff;
}


/* =========================
   AUTH PAGES
   ========================= */

.auth-container {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(
            circle at top,
            #18181b 0%,
            #09090b 55%
        );
}

.auth-card {
    width: 100%;
    max-width: 420px;

    padding: 40px;

    background: #111113;

    border: 1px solid #27272a;
    border-radius: 18px;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45);
}

.logo {
    text-align: center;

    font-size: 28px;
    font-weight: 700;

    margin-bottom: 30px;
}

.logo span {
    color: #8b5cf6;
}

.auth-card h1 {
    margin: 0;

    text-align: center;

    font-size: 26px;
}

.subtitle {
    margin: 10px 0 30px;

    text-align: center;

    color: #a1a1aa;

    line-height: 1.5;
}


/* =========================
   FORMS
   ========================= */

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

.form-group label {
    display: block;

    margin-bottom: 8px;

    font-size: 14px;

    color: #d4d4d8;
}

.form-group input {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #3f3f46;
    border-radius: 10px;

    background: #18181b;
    color: #ffffff;

    font-size: 15px;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input:focus {
    border-color: #8b5cf6;

    box-shadow:
        0 0 0 3px rgba(139, 92, 246, 0.12);
}

.form-group input::placeholder {
    color: #71717a;
}


/* =========================
   PRIMARY BUTTON
   ========================= */

.btn-primary {
    width: 100%;

    padding: 14px;

    border: 0;
    border-radius: 10px;

    background: #8b5cf6;

    color: #ffffff;

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.15s ease,
        transform 0.1s ease;
}

.btn-primary:hover {
    background: #7c3aed;
}

.btn-primary:active {
    transform: translateY(1px);
}


/* =========================
   ERRORS
   ========================= */

.error-message {
    min-height: 20px;

    margin-bottom: 10px;

    color: #f87171;

    font-size: 14px;

    text-align: center;

    line-height: 1.4;
}


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

.auth-footer {
    margin-top: 25px;

    text-align: center;

    color: #a1a1aa;

    font-size: 14px;
}

.auth-footer a {
    color: #a78bfa;

    text-decoration: none;
}

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


/* =========================
   DASHBOARD
   ========================= */

.dashboard {
    min-height: 100vh;

    background: #09090b;
}


/* =========================
   TOPBAR
   ========================= */

.topbar {
    min-height: 72px;

    padding: 0 35px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    background: #111113;

    border-bottom: 1px solid #27272a;
}

.topbar-logo {
    font-size: 24px;

    font-weight: 700;

    white-space: nowrap;
}

.topbar-logo span {
    color: #8b5cf6;
}

.topbar-user {
    display: flex;

    align-items: center;

    gap: 20px;
}

.user-info {
    text-align: right;
}

.user-label {
    font-size: 12px;

    color: #71717a;
}

.username {
    margin-top: 3px;

    font-size: 15px;

    font-weight: 600;
}


/* =========================
   LOGOUT
   ========================= */

.btn-logout {
    padding: 9px 16px;

    border: 1px solid #3f3f46;
    border-radius: 8px;

    background: #18181b;

    color: #ffffff;

    font-size: 14px;

    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.btn-logout:hover {
    background: #27272a;

    border-color: #52525b;
}


/* =========================
   DASHBOARD CONTENT
   ========================= */

.dashboard-content {
    width: 100%;

    max-width: 1200px;

    margin: 0 auto;

    padding: 45px 25px;
}

.welcome h1 {
    margin: 0;

    font-size: 32px;

    line-height: 1.2;
}

.welcome p {
    margin-top: 10px;

    color: #a1a1aa;

    font-size: 15px;
}


/* =========================
   STATISTICS
   ========================= */

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 20px;

    margin-top: 35px;
}

.stat-card {
    padding: 25px;

    background: #111113;

    border: 1px solid #27272a;

    border-radius: 14px;

    transition:
        border-color 0.15s ease,
        transform 0.15s ease;
}

.stat-card:hover {
    border-color: #3f3f46;

    transform: translateY(-1px);
}

.stat-title {
    color: #a1a1aa;

    font-size: 14px;
}

.stat-value {
    margin-top: 12px;

    font-size: 30px;

    font-weight: 700;
}

.status-active {
    margin-top: 12px;

    font-size: 18px;

    font-weight: 600;

    color: #4ade80;
}


/* =========================
   VPN CONFIGURATIONS
   ========================= */

.configs-section {
    margin-top: 35px;

    padding: 30px;

    background: #111113;

    border: 1px solid #27272a;

    border-radius: 14px;
}

.section-header h2 {
    margin: 0;

    font-size: 22px;
}

.section-header p {
    margin-top: 8px;

    color: #71717a;

    line-height: 1.5;
}

.configs-empty {
    margin-top: 25px;

    padding: 55px 20px;

    text-align: center;

    border: 1px dashed #3f3f46;

    border-radius: 12px;
}

.empty-icon {
    width: 60px;
    height: 60px;

    margin: 0 auto;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background: #18181b;

    color: #a78bfa;

    font-size: 14px;

    font-weight: 700;
}

.configs-empty h3 {
    margin-top: 20px;

    margin-bottom: 0;

    font-size: 18px;
}

.configs-empty p {
    max-width: 500px;

    margin: 10px auto 0;

    color: #71717a;

    line-height: 1.6;

    font-size: 14px;
}


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

@media (max-width: 700px) {

    .topbar {
        min-height: 64px;

        padding: 15px 20px;

        gap: 15px;
    }

    .topbar-user {
        gap: 10px;
    }

    .user-info {
        display: none;
    }

    .topbar-logo {
        font-size: 21px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-content {
        padding: 30px 18px;
    }

    .welcome h1 {
        font-size: 26px;
    }

    .configs-section {
        padding: 22px 18px;
    }
}


@media (max-width: 480px) {

    .auth-card {
        padding: 30px 22px;

        border-radius: 15px;
    }

    .auth-card h1 {
        font-size: 23px;
    }

    .logo {
        font-size: 25px;
    }

    .dashboard-content {
        padding: 25px 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .configs-empty {
        padding: 40px 15px;
    }

}

/* =========================
   VPN CONFIG ACTIONS
   ========================= */

.config-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.config-actions .btn-primary,
.config-actions .btn-secondary {
    flex: 1 1 220px;
}

/* =========================
   QR MODAL
   ========================= */

.qr-modal-content {
    width: 100%;
    max-width: 760px;
}

.qr-images {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(240px, 1fr)
        );
    gap: 20px;
    margin-top: 20px;
}

.qr-item {
    text-align: center;
}

.qr-label {
    margin-bottom: 10px;
    color: #d4d4d8;
    font-size: 15px;
    font-weight: 600;
}

.qr-image {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
    padding: 12px;
    background: #ffffff;
    border-radius: 12px;
}

.qr-loading,
.qr-error {
    padding: 30px 10px;
    text-align: center;
    color: #a1a1aa;
    line-height: 1.5;
}

.qr-error {
    color: #f87171;
}

/* =========================
   MOBILE QR
   ========================= */

@media (max-width: 600px) {
    .config-actions {
        flex-direction: column;
    }

    .config-actions .btn-primary,
    .config-actions .btn-secondary {
        width: 100%;
        flex-basis: auto;
    }

    .qr-modal-content {
        max-width: calc(100vw - 30px);
    }

    .qr-images {
        grid-template-columns: 1fr;
    }

    .qr-image {
        max-width: 280px;
    }
}


/* =========================
   NEW USER DASHBOARD
   ========================= */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.section-header > div {
    min-width: 0;
}

.section-header .btn-primary {
    width: auto;
    min-width: 220px;
    white-space: nowrap;
}

.config-card {
    margin-top: 18px;
    padding: 22px;
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 12px;
    transition:
        border-color 0.15s ease,
        transform 0.15s ease;
}

.config-card:hover {
    border-color: #3f3f46;
    transform: translateY(-1px);
}

.config-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.config-name {
    display: inline-block;
    font-size: 18px;
    font-weight: 700;
}

.new-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #8b5cf6;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
}

.config-server {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #27272a;
}

.config-server span {
    color: #71717a;
    font-size: 13px;
}

.config-server strong {
    color: #d4d4d8;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

.config-date {
    margin-top: 10px;
    color: #71717a;
    font-size: 13px;
}

.config-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.config-actions .btn-primary {
    width: 100%;
}

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

.btn-primary:disabled:hover {
    background: #8b5cf6;
}

.status-inactive {
    margin-top: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #f87171;
}

@media (max-width: 700px) {

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .section-header .btn-primary {
        width: 100%;
        min-width: 0;
    }

    .config-server {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .config-server strong {
        text-align: left;
    }
}

