/* ===========================================================
   Электронная очередь · Почта России
   Современный интерфейс: стекло, градиенты, 3D-кнопки
   =========================================================== */

:root {
    --bg-0: #0a0e1f;
    --bg-1: #121831;

    --glass: rgba(255, 255, 255, 0.055);
    --glass-brd: rgba(255, 255, 255, 0.12);
    --glass-hi: rgba(255, 255, 255, 0.5);

    --ink: #eaf0ff;
    --ink-soft: #aeb8d8;
    --ink-mute: #7c87ad;

    --blue: #4f7cff;
    --blue-deep: #2c49c9;
    --green: #18c08a;
    --green-deep: #0e8a62;

    --r-card: 28px;
    --r-pad: 20px;
    --r-btn: 18px;

    --shadow-card: 0 30px 60px -25px rgba(0, 0, 0, 0.75);

    --font-display: "Space Grotesk", "Manrope", system-ui, sans-serif;
    --font-body: "Manrope", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--font-body);
    color: var(--ink);
    text-align: center;
    background: radial-gradient(140% 120% at 50% -10%, var(--bg-1), var(--bg-0) 60%);
    overflow-x: auto;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

/* ---------- Анимированный фон ---------- */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 46vmax;
    height: 46vmax;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    will-change: transform;
}

.blob--1 {
    background: #3a5bff;
    top: -16vmax;
    left: -10vmax;
    animation: drift1 22s ease-in-out infinite;
}

.blob--2 {
    background: #12b886;
    bottom: -18vmax;
    right: -12vmax;
    animation: drift2 26s ease-in-out infinite;
}

.blob--3 {
    background: #7a3cff;
    top: 30%;
    left: 55%;
    width: 34vmax;
    height: 34vmax;
    opacity: 0.35;
    animation: drift1 30s ease-in-out infinite reverse;
}

@keyframes drift1 {
    50% { transform: translate(8vmax, 6vmax) scale(1.12); }
}

@keyframes drift2 {
    50% { transform: translate(-7vmax, -5vmax) scale(1.1); }
}

/* ---------- Шапка ---------- */
.topbar {
    width: min(1100px, 92vw);
    margin-top: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-display);
    letter-spacing: 0.2px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 22px;
    background: linear-gradient(155deg, var(--blue), var(--blue-deep));
    box-shadow: 0 10px 24px -8px rgba(79, 124, 255, 0.8), inset 0 1px 0 var(--glass-hi);
}

.brand-text {
    font-size: clamp(0.95rem, 2.4vw, 1.25rem);
    color: var(--ink-soft);
    font-weight: 500;
}

.brand-text i {
    color: var(--ink-mute);
    font-style: normal;
    margin: 0 2px;
}

.brand-text b {
    color: var(--ink);
    font-weight: 700;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #b8ffe6;
    background: rgba(24, 192, 138, 0.12);
    border: 1px solid rgba(24, 192, 138, 0.35);
}

.brand-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(24, 192, 138, 0.7);
    animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 9px rgba(24, 192, 138, 0); }
    100% { box-shadow: 0 0 0 0 rgba(24, 192, 138, 0); }
}

/* ---------- Сцена / колонки ---------- */
.stage {
    flex: 1;
    width: min(1100px, 92vw);
    margin: clamp(28px, 6vh, 64px) 0 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 3vw, 36px);
    align-items: stretch;
}

.column {
    display: flex;
}

/* Сброс старых жёстких размеров колонок */
.column1, .column2 {
    margin: 0;
    width: auto;
    height: auto;
}

/* ---------- Карточка ---------- */
.card {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: clamp(22px, 3vw, 34px);
    border-radius: var(--r-card);
    background: var(--glass);
    border: 1px solid var(--glass-brd);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--glass-hi), transparent);
    opacity: 0.6;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 40px 70px -25px rgba(0, 0, 0, 0.8);
}

.card--visitor { --accent: var(--blue); --accent-deep: var(--blue-deep); }
.card--operator { --accent: var(--green); --accent-deep: var(--green-deep); }

/* ---------- Заголовок карточки ---------- */
.card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(18px, 3vw, 28px);
}

.card-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: none;
    font-size: 24px;
    line-height: 1;
    overflow: hidden;
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    box-shadow: inset 0 1px 0 var(--glass-hi);
}

h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

/* ---------- Табло (.vyvod) ---------- */
.visitor, .operator {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: clamp(18px, 3vw, 26px);
}

.vyvod {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 0;
    padding: clamp(26px, 5vw, 44px) 20px;
    width: 100%;
    height: auto;
    font-size: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    background:
        radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
        rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 2px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.vyvod-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

.number {
    margin: 0;
    white-space: nowrap;
    font-family: var(--font-display);
    font-size: clamp(3.4rem, 13vw, 6rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, #ffffff, color-mix(in srgb, var(--accent) 70%, #ffffff));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--accent);
    text-shadow: 0 0 38px color-mix(in srgb, var(--accent) 55%, transparent);
}

.slova {
    margin: 0;
    min-height: 1.4em;
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
    font-weight: 500;
    color: var(--ink-soft);
}

/* Анимация смены номера */
.number.pop {
    animation: pop 0.42s cubic-bezier(0.22, 1.2, 0.36, 1);
}

@keyframes pop {
    0% { transform: scale(0.78); opacity: 0.25; filter: blur(2px); }
    60% { transform: scale(1.06); opacity: 1; filter: blur(0); }
    100% { transform: scale(1); }
}

/* ===========================================================
   3D-КНОПКИ
   =========================================================== */
.btn3d {
    position: relative;
    width: 100%;
    border: none;
    border-radius: var(--r-btn);
    padding: 20px 28px;
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fff;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background: linear-gradient(180deg, var(--btn-hi), var(--btn-lo));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -2px 6px rgba(0, 0, 0, 0.25),
        0 7px 0 var(--btn-edge),
        0 16px 28px -8px var(--btn-glow);
    transform: translateY(0);
    transition: transform 0.09s ease, box-shadow 0.09s ease, filter 0.2s ease;
}

.btn3d::after {
    content: "";
    position: absolute;
    inset: 1px 1px 50% 1px;
    border-radius: calc(var(--r-btn) - 2px) calc(var(--r-btn) - 2px) 40% 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), transparent);
    pointer-events: none;
}

.btn3d:hover {
    filter: brightness(1.06);
}

.btn3d:active {
    transform: translateY(6px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 4px rgba(0, 0, 0, 0.25),
        0 1px 0 var(--btn-edge),
        0 6px 14px -8px var(--btn-glow);
}

.btn3d:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

.btn3d--blue {
    --btn-hi: #5d86ff;
    --btn-lo: #3a63f0;
    --btn-edge: #2138a8;
    --btn-glow: rgba(79, 124, 255, 0.65);
}

.btn3d--green {
    --btn-hi: #2ad79c;
    --btn-lo: #13a877;
    --btn-edge: #0a6e4d;
    --btn-glow: rgba(24, 192, 138, 0.6);
}

/* ---------- Адаптив ---------- */
@media (max-width: 760px) {
    .stage {
        grid-template-columns: 1fr;
        margin-top: 26px;
    }

    .topbar {
        margin-top: 22px;
    }

    .brand-badge {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blob, .brand-badge::before, .number.pop {
        animation: none !important;
    }

    .card, .btn3d {
        transition: none;
    }
}
