:root {
    --vp-bg: #0b1438;
    --vp-surface: rgba(13, 25, 61, 0.78);
    --vp-surface-border: rgba(110, 144, 255, 0.28);
    --vp-text: #e9f2ff;
    --vp-text-muted: #9fb1d9;
    --vp-cyan: #2bd1ff;
    --vp-indigo: #7f85ff;
    --vp-violet: #d74bff;
    --vp-error: #ff6d8f;
    --vp-success: #7bf7cf;
    --vp-shadow: 0 18px 55px rgba(6, 12, 30, 0.46);
}

html,
body {
    margin: 0;
    font-family: "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
    color: var(--vp-text);
    background-color: var(--vp-bg);
}

h1,
h2,
h3,
p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: calc(100dvh - 110px);
    padding: 0.5rem 0;
}

.neon-card {
    width: min(100%, 460px);
    border-radius: 1.1rem;
    background: linear-gradient(150deg, rgba(13, 24, 63, 0.92), rgba(16, 22, 67, 0.86));
    border: 1px solid var(--vp-surface-border);
    box-shadow: var(--vp-shadow);
    padding: 1.25rem;
    backdrop-filter: blur(8px);
}

.login-logo {
    width: 4.2rem;
    height: 4.2rem;
    border-radius: 0.85rem;
    object-fit: cover;
    margin-bottom: 0.7rem;
    box-shadow: 0 0 28px rgba(113, 95, 255, 0.35);
}

.brand-title {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.35rem;
    background: linear-gradient(94deg, #50ddff 0%, #7f85ff 45%, #d74bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    color: var(--vp-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.step-panel {
    display: grid;
    gap: 0.75rem;
    transition: opacity 220ms ease, transform 220ms ease, max-height 220ms ease;
}

.step-visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 360px;
}

.step-hidden {
    opacity: 0;
    transform: translateY(10px);
    max-height: 0;
    pointer-events: none;
    overflow: hidden;
}

.field-label {
    color: #dbe7ff;
    font-size: 0.9rem;
    font-weight: 600;
}

.field-input {
    width: 100%;
    border: 1px solid rgba(114, 150, 255, 0.4);
    background: rgba(9, 18, 44, 0.72);
    color: var(--vp-text);
    padding: 0.72rem 0.8rem;
    border-radius: 0.7rem;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field-input:focus {
    border-color: var(--vp-cyan);
    box-shadow: 0 0 0 3px rgba(43, 209, 255, 0.18);
}

.action-row {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn-neon,
.btn-secondary,
.btn-neon-outline {
    border-radius: 0.7rem;
    border: 1px solid transparent;
    padding: 0.62rem 0.92rem;
    font-weight: 600;
    transition: transform 160ms ease, opacity 160ms ease, box-shadow 180ms ease;
}

.btn-neon:hover,
.btn-secondary:hover,
.btn-neon-outline:hover {
    transform: translateY(-1px);
}

.btn-neon {
    background: linear-gradient(100deg, #30d5ff 0%, #657cff 47%, #d74bff 100%);
    color: #070a1a;
    box-shadow: 0 10px 28px rgba(129, 88, 255, 0.38);
}

.btn-secondary,
.btn-neon-outline {
    border-color: rgba(129, 151, 255, 0.4);
    background: rgba(10, 20, 52, 0.5);
    color: #deebff;
}

.btn-neon-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

button:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

.state-error,
.state-info {
    min-height: 1.1rem;
    font-size: 0.86rem;
}

.state-error {
    color: var(--vp-error);
}

.state-info {
    color: var(--vp-success);
}

.dashboard-shell {
    display: grid;
    gap: 1rem;
}

.dashboard-header {
    padding: 0.95rem 1.05rem;
    border: 1px solid var(--vp-surface-border);
    border-radius: 1rem;
    background: var(--vp-surface);
}

.dashboard-title {
    font-size: 1.25rem;
    margin-bottom: 0.35rem;
}

.dashboard-subtitle {
    color: var(--vp-text-muted);
    font-size: 0.9rem;
}

.phone-accent {
    font-weight: 700;
    background: linear-gradient(94deg, #50ddff 0%, #7f85ff 45%, #d74bff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-section {
    border: 1px solid var(--vp-surface-border);
    border-radius: 1rem;
    background: var(--vp-surface);
    padding: 1rem;
}

.account-section {
    margin-bottom: 0.95rem;
}

.info-grid {
    display: grid;
    gap: 0.7rem;
}

.info-card {
    border-radius: 0.85rem;
    border: 1px solid rgba(121, 141, 255, 0.3);
    padding: 0.8rem 0.85rem;
    background: linear-gradient(130deg, rgba(13, 21, 56, 0.86), rgba(15, 27, 69, 0.74));
    display: grid;
    gap: 0.35rem;
}

.info-label {
    color: var(--vp-text-muted);
    font-size: 0.82rem;
}

.info-value {
    font-size: 1rem;
    font-weight: 700;
}

.section-title {
    font-size: 1.02rem;
    margin-bottom: 0.85rem;
}

.apps-grid {
    display: grid;
    gap: 0.7rem;
}

.app-card {
    border-radius: 0.78rem;
    border: 1px solid rgba(121, 141, 255, 0.36);
    padding: 0.78rem 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    min-height: 5.5rem;
    text-align: center;
    background: linear-gradient(120deg, rgba(16, 23, 64, 0.94), rgba(14, 28, 74, 0.84));
    animation: app-card-pulse 4s ease-in-out infinite;
}

.apps-grid > :nth-child(2) { animation-delay: 1.35s; }
.apps-grid > :nth-child(3) { animation-delay: 2.7s; }

.app-card-body {
    display: grid;
    gap: 0.1rem;
}

.app-store-label {
    font-size: 0.76rem;
    color: var(--vp-text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.app-card-name {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
}

.app-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-icon-wrap {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #dbe6ff;
}

.app-icon-svg {
    width: 100%;
    height: 100%;
}

.ios-import-btn {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
}

.key-card {
    border-radius: 0.85rem;
    border: 1px solid rgba(121, 141, 255, 0.32);
    padding: 0.78rem;
    display: grid;
    gap: 0.65rem;
    background: linear-gradient(120deg, rgba(13, 21, 56, 0.9), rgba(15, 27, 69, 0.78));
}

.key-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
}

.key-clickable {
    cursor: pointer;
    outline: none;
}

.key-clickable:focus-visible {
    border-color: rgba(43, 209, 255, 0.65);
    box-shadow: 0 0 0 3px rgba(43, 209, 255, 0.18);
}

.key-header h3 {
    font-size: 0.95rem;
}

.key-country {
    margin-top: 0.18rem;
    display: flex;
    align-items: center;
    gap: 0.36rem;
    color: #b9cbf3;
    font-size: 0.8rem;
    line-height: 1.25;
}

.key-country-flag {
    font-size: 0.95rem;
    line-height: 1;
}

.key-country-code {
    font-weight: 700;
    color: #dbe7ff;
    letter-spacing: 0.04em;
}

.key-country-name {
    color: #9fb9eb;
}

.key-value {
    display: block;
    white-space: pre-wrap;
    word-break: break-all;
    color: #9fd4ff;
    font-size: 0.79rem;
    line-height: 1.35;
}

.icon-btn {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
}

.icon-svg {
    width: 1.1rem;
    height: 1.1rem;
}

.cookie-banner {
    position: fixed;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.8rem;
    z-index: 1200;
}

.cookie-banner-content {
    border: 1px solid rgba(121, 141, 255, 0.36);
    border-radius: 0.9rem;
    background: rgba(10, 19, 49, 0.94);
    box-shadow: var(--vp-shadow);
    padding: 0.9rem;
    backdrop-filter: blur(7px);
}

.cookie-banner-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.22rem;
}

.cookie-banner-text {
    color: var(--vp-text-muted);
    font-size: 0.83rem;
    line-height: 1.35;
}

.cookie-actions {
    margin-top: 0.7rem;
}

.cookie-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(3, 8, 25, 0.62);
    display: grid;
    align-items: end;
}

.cookie-settings-panel {
    border: 1px solid rgba(121, 141, 255, 0.4);
    border-radius: 1rem 1rem 0 0;
    background: rgba(10, 19, 49, 0.97);
    padding: 1rem;
    box-shadow: 0 -10px 34px rgba(4, 10, 26, 0.56);
}

.cookie-settings-title {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.cookie-settings-text {
    color: var(--vp-text-muted);
    font-size: 0.82rem;
    line-height: 1.35;
    margin-bottom: 0.7rem;
}

.cookie-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.48rem 0;
    font-size: 0.86rem;
    color: #dbe7ff;
}

.cookie-option input {
    accent-color: var(--vp-cyan);
}

.cookie-settings-actions {
    margin-top: 0.8rem;
}

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes app-card-pulse {
    0%, 60%, 100% {
        box-shadow: 0 4px 18px rgba(6, 12, 30, 0.4);
        border-color: rgba(121, 141, 255, 0.36);
    }
    30% {
        box-shadow: 0 0 22px rgba(127, 133, 255, 0.55), 0 0 8px rgba(43, 209, 255, 0.3);
        border-color: rgba(127, 133, 255, 0.72);
    }
}

#blazor-error-ui {
    background: #ffdce5;
    color: #420615;
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 0.7rem 1.1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.22);
    z-index: 999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.8rem;
    top: 0.4rem;
}

@media (min-width: 768px) {
    .neon-card {
        padding: 1.45rem;
    }

    .apps-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-title {
        font-size: 1.4rem;
    }

    .cookie-banner {
        left: 1.1rem;
        right: auto;
        bottom: 1.1rem;
        max-width: 31rem;
    }

    .cookie-settings-overlay {
        align-items: center;
        justify-items: center;
        padding: 1.2rem;
    }

    .cookie-settings-panel {
        width: min(100%, 30rem);
        border-radius: 1rem;
    }
}

@media (hover: hover) and (pointer: fine) {
    .app-card,
    .key-card,
    .btn-neon,
    .btn-neon-outline,
    .btn-secondary {
        background-size: 200% 200%;
    }

    .app-card:hover,
    .key-card:hover,
    .btn-neon:hover,
    .btn-neon-outline:hover,
    .btn-secondary:hover {
        animation: gradient-shift 2.1s ease infinite;
        box-shadow: 0 10px 28px rgba(111, 94, 255, 0.28);
    }

    .btn-neon-outline:hover,
    .btn-secondary:hover {
        background-image: linear-gradient(104deg, rgba(43, 209, 255, 0.28), rgba(127, 133, 255, 0.32), rgba(215, 75, 255, 0.26));
    }

    .app-card:hover {
        animation: gradient-shift 2s ease infinite;
        background-image: linear-gradient(
            104deg,
            rgba(43, 209, 255, 0.26),
            rgba(127, 133, 255, 0.32),
            rgba(215, 75, 255, 0.26),
            rgba(43, 209, 255, 0.26)
        );
        background-size: 300% 300%;
        border-color: rgba(129, 151, 255, 0.72);
        box-shadow: 0 0 24px rgba(127, 133, 255, 0.45);
    }
}
