/* =========================================================
   GLOBAL RESET
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 100%;

    overflow-x: hidden;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;

    overflow-x: hidden;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background:
        radial-gradient(
            circle at top,
            rgba(56, 189, 248, 0.12),
            transparent 38%
        ),
        #07111f;

    color: #e5edf7;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* =========================================================
   PAGE
   ========================================================= */

.page {
    width: 100%;
    min-width: 0;

    min-height: 100vh;
    min-height: 100dvh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding:
        max(24px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(24px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
}

/* =========================================================
   CALLBACK CARD
   ========================================================= */

.callback-card {
    width: min(100%, 520px);

    min-width: 0;

    padding: clamp(24px, 5vw, 42px);

    border: 1px solid rgba(255, 255, 255, 0.09);

    border-radius: clamp(18px, 4vw, 26px);

    background:
        linear-gradient(
            145deg,
            rgba(20, 35, 54, 0.96),
            rgba(10, 22, 37, 0.96)
        );

    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.35);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    text-align: center;
}

/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;

    min-width: 0;

    margin-bottom: 30px;
}

.brand-icon {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background: #0ea5e9;

    color: #ffffff;

    font-size: 22px;
    font-weight: 800;
}

.brand-text {
    min-width: 0;

    display: flex;
    flex-direction: column;

    align-items: flex-start;

    text-align: left;
}

.brand-title {
    max-width: 100%;

    font-size: 16px;
    font-weight: 700;

    overflow-wrap: anywhere;
}

.brand-subtitle {
    margin-top: 2px;

    color: #8fa3b8;

    font-size: 12px;

    overflow-wrap: anywhere;
}

/* =========================================================
   STATUS AREA
   ========================================================= */

.status-area {
    width: 100%;
    min-width: 0;
}

.state {
    display: none;

    width: 100%;
    min-width: 0;
}

.state.active {
    display: block;
}

.state h1 {
    margin: 22px 0 10px;

    font-size: clamp(21px, 5vw, 27px);

    line-height: 1.2;

    overflow-wrap: anywhere;
}

.state p {
    width: 100%;
    max-width: 430px;

    margin: 0 auto;

    color: #aab9c9;

    font-size: clamp(14px, 3.8vw, 16px);

    line-height: 1.65;

    overflow-wrap: anywhere;
}

/* =========================================================
   LOADING SPINNER
   ========================================================= */

.spinner {
    width: 48px;
    height: 48px;

    margin: 0 auto;

    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: #38bdf8;

    border-radius: 50%;

    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   STATUS ICON
   ========================================================= */

.status-icon {
    width: 54px;
    height: 54px;

    margin: 0 auto;

    display: grid;
    place-items: center;

    border-radius: 50%;

    font-size: 26px;
    font-weight: 800;
}

.success-icon {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
}

.error-icon {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}

/* =========================================================
   SMALL TEXT
   ========================================================= */

.small-text {
    margin-top: 12px !important;

    font-size: 13px !important;

    color: #7f93a8 !important;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.primary-button,
.secondary-button {
    width: min(100%, 320px);

    min-height: 48px;

    margin-top: 22px;

    padding: 12px 20px;

    border-radius: 12px;

    font: inherit;
    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        background 0.15s ease;
}

.primary-button {
    border: 0;

    background: #0ea5e9;

    color: #ffffff;
}

.secondary-button {
    border: 1px solid rgba(255, 255, 255, 0.15);

    background: rgba(255, 255, 255, 0.05);

    color: #e5edf7;
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
    transform: translateY(0);
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
    outline: 3px solid rgba(56, 189, 248, 0.4);
    outline-offset: 3px;
}

/* =========================================================
   SECURITY NOTE
   ========================================================= */

.security-note {
    width: 100%;
    min-width: 0;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    gap: 7px;

    margin-top: 28px;

    padding-top: 20px;

    border-top: 1px solid rgba(255, 255, 255, 0.07);

    color: #72869b;

    font-size: 11px;

    line-height: 1.5;

    text-align: left;
}

.security-note span:last-child {
    min-width: 0;

    overflow-wrap: anywhere;
}

/* =========================================================
   NOSCRIPT
   ========================================================= */

.noscript-message {
    position: fixed;

    left: 16px;
    right: 16px;
    bottom: 16px;

    z-index: 9999;

    padding: 14px 16px;

    border-radius: 12px;

    background: #7f1d1d;

    color: #ffffff;

    font-size: 14px;

    text-align: center;
}

/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width: 360px) {

    .page {
        align-items: flex-start;

        padding-top:
            max(18px, env(safe-area-inset-top));
    }

    .callback-card {
        padding: 22px 18px;
    }

    .brand {
        margin-bottom: 24px;
    }

    .brand-icon {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }
}

/* =========================================================
   LANDSCAPE PHONES / SHORT SCREENS
   ========================================================= */

@media (max-height: 520px) and (orientation: landscape) {

    .page {
        align-items: flex-start;

        padding-top: 18px;
        padding-bottom: 18px;
    }

    .callback-card {
        margin: 0 auto;
    }

    .brand {
        margin-bottom: 18px;
    }

    .state h1 {
        margin-top: 15px;
    }

    .security-note {
        margin-top: 18px;
        padding-top: 14px;
    }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

