:root {
    color-scheme: light;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    --background: #f4f6f8;
    --background-secondary: #edf1f5;

    --surface: rgba(255, 255, 255, 0.9);

    --text: #18202a;
    --muted: #6f7883;

    --border-soft: rgba(255, 255, 255, 0.82);

    --accent: #2563eb;
    --accent-secondary: #3b82f6;

    --status-background: #eef5ff;
    --status-text: #2563eb;

    --info-background: rgba(37, 99, 235, 0.06);
    --info-border: rgba(37, 99, 235, 0.12);

    --shadow: 0 24px 70px rgba(25, 35, 50, 0.12);

    --toggle-background: rgba(255, 255, 255, 0.78);
    --toggle-border: rgba(24, 32, 42, 0.1);
    --toggle-thumb: #ffffff;
    --toggle-icon: #f59e0b;
    --toggle-shadow: 0 10px 30px rgba(25, 35, 50, 0.14);
}

html[data-theme="dark"] {
    color-scheme: dark;

    --background: #0c1118;
    --background-secondary: #121923;

    --surface: rgba(19, 27, 38, 0.9);

    --text: #edf3f8;
    --muted: #9ba8b7;

    --border-soft: rgba(255, 255, 255, 0.06);

    --accent: #3b82f6;
    --accent-secondary: #60a5fa;

    --status-background: rgba(59, 130, 246, 0.12);
    --status-text: #8fbcff;

    --info-background: rgba(59, 130, 246, 0.08);
    --info-border: rgba(96, 165, 250, 0.14);

    --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);

    --toggle-background: rgba(19, 27, 38, 0.88);
    --toggle-border: rgba(255, 255, 255, 0.1);
    --toggle-thumb: #243244;
    --toggle-icon: #c4d7ff;
    --toggle-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--background);
}

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

    display: grid;
    place-items: center;

    padding:
        max(24px, env(safe-area-inset-top))
        max(24px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(24px, env(safe-area-inset-left));

    color: var(--text);

    background:
        radial-gradient(
            circle at 16% 18%,
            rgba(37, 99, 235, 0.14),
            transparent 34%
        ),
        radial-gradient(
            circle at 84% 82%,
            rgba(59, 130, 246, 0.08),
            transparent 32%
        ),
        linear-gradient(
            145deg,
            var(--background),
            var(--background-secondary)
        );

    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}

button {
    -webkit-tap-highlight-color: transparent;
}

.page {
    width: 100%;
    max-width: 520px;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;

    margin-bottom: 22px;

    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    color: #ffffff;
    background:
        linear-gradient(
            145deg,
            var(--accent-secondary),
            var(--accent)
        );

    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.24);
}

.card {
    padding: 42px;

    border: 1px solid var(--border-soft);
    border-radius: 24px;

    background: var(--surface);
    box-shadow: var(--shadow);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    text-align: center;

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

.status {
    width: max-content;
    margin: 0 auto 22px;
    padding: 8px 12px;

    display: flex;
    align-items: center;
    gap: 8px;

    border-radius: 999px;

    color: var(--status-text);
    background: var(--status-background);

    font-size: 13px;
    font-weight: 650;
}

.status-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: currentColor;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.1);

    animation: pulse 2s ease-in-out infinite;
}

h1 {
    max-width: 420px;
    margin: 0 auto;

    font-size: clamp(28px, 6vw, 38px);
    line-height: 1.14;
    letter-spacing: -0.045em;
}

.subtitle {
    max-width: 410px;
    margin: 18px auto 30px;

    color: var(--muted);

    font-size: 15px;
    line-height: 1.65;
}

.progress {
    width: 100%;
    height: 6px;

    margin-bottom: 28px;

    overflow: hidden;

    border-radius: 999px;

    background: var(--info-background);
}

.progress-bar {
    width: 42%;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--accent),
            var(--accent-secondary)
        );

    animation: progress 3.5s ease-in-out infinite;
}

.info {
    padding: 14px 16px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    border: 1px solid var(--info-border);
    border-radius: 13px;

    color: var(--muted);
    background: var(--info-background);

    font-size: 13px;
    line-height: 1.5;
}

.info-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;

    color: var(--accent-secondary);
}

.footer {
    margin-top: 22px;

    color: var(--muted);

    font-size: 12px;
    text-align: center;
}

.theme-toggle {
    position: fixed;
    top: max(18px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    z-index: 10;

    width: 58px;
    height: 34px;
    padding: 0;

    border: 1px solid var(--toggle-border);
    border-radius: 999px;

    cursor: pointer;

    background: var(--toggle-background);
    box-shadow: var(--toggle-shadow);

    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

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

.theme-toggle-track {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.theme-toggle-thumb {
    position: absolute;
    top: 4px;
    left: 4px;

    width: 24px;
    height: 24px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    color: var(--toggle-icon);
    background: var(--toggle-thumb);

    box-shadow:
        0 2px 7px rgba(15, 23, 42, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.14);

    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.25s ease,
        background 0.25s ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(24px);
}

.theme-icon {
    position: absolute;

    width: 15px;
    height: 15px;

    transition:
        opacity 0.2s ease,
        transform 0.25s ease;
}

.theme-icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon-moon {
    opacity: 0;
    transform: rotate(-20deg) scale(0.7);
}

html[data-theme="dark"] .theme-icon-sun {
    opacity: 0;
    transform: rotate(30deg) scale(0.7);
}

html[data-theme="dark"] .theme-icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

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

    50% {
        opacity: 0.55;
        transform: scale(0.82);
    }
}

@keyframes progress {
    0% {
        transform: translateX(-110%);
    }

    50% {
        transform: translateX(70%);
    }

    100% {
        transform: translateX(250%);
    }
}

@media (max-width: 600px) {
    body {
        padding:
            max(76px, env(safe-area-inset-top))
            max(16px, env(safe-area-inset-right))
            max(24px, env(safe-area-inset-bottom))
            max(16px, env(safe-area-inset-left));
    }

    .page {
        max-width: 100%;
    }

    .card {
        padding: 34px 24px;
        border-radius: 20px;
    }

    .subtitle {
        margin-bottom: 26px;
    }

    .info {
        align-items: flex-start;
        text-align: left;
    }

    .theme-toggle {
        top: max(16px, env(safe-area-inset-top));
        right: max(16px, env(safe-area-inset-right));
    }
}

@media (max-width: 360px) {
    body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .card {
        padding: 30px 18px;
    }

    .brand {
        font-size: 16px;
    }

    .subtitle {
        font-size: 14px;
    }
}

@media (max-height: 620px) and (orientation: landscape) {
    body {
        place-items: start center;
        padding-top: 70px;
        padding-bottom: 24px;
    }

    .card {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .status {
        margin-bottom: 16px;
    }

    .subtitle {
        margin-top: 12px;
        margin-bottom: 22px;
    }
}

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