:root {
    --mc-primary: #1a1a2e;
    --mc-accent: #e94560;
    --mc-accent-dark: #c73a52;
    --mc-light: #f8f9fa;
    --mc-muted: #6c757d;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--mc-light);
    min-height: 100vh;
}

.mc-brand {
    color: var(--mc-accent);
    font-weight: 700;
}

.btn-mc {
    background: var(--mc-accent);
    border-color: var(--mc-accent);
    color: #fff;
    min-height: 48px;
    font-weight: 600;
}

.btn-mc:hover,
.btn-mc:focus {
    background: var(--mc-accent-dark);
    border-color: var(--mc-accent-dark);
    color: #fff;
}

.btn-mc-outline {
    border-color: var(--mc-accent);
    color: var(--mc-accent);
    min-height: 48px;
    font-weight: 600;
}

.btn-mc-outline:hover {
    background: var(--mc-accent);
    color: #fff;
}

.mc-hero {
    background: linear-gradient(160deg, var(--mc-primary) 0%, #16213e 100%);
    color: #fff;
    padding: 3rem 0 4rem;
}

.mc-card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.08);
}

.mc-status-badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
}

.mc-status-waiting { background: #fff3cd; color: #856404; }
.mc-status-called { background: #d1e7dd; color: #0f5132; }
.mc-status-expired { background: #f8d7da; color: #842029; }
.mc-status-served { background: #cfe2ff; color: #084298; }

.mc-countdown {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--mc-accent);
    font-variant-numeric: tabular-nums;
}

.mc-countdown.is-low {
    color: #dc3545;
}

.mc-countdown-dashboard {
    font-size: 2rem;
    line-height: 1.2;
}

.mc-countdown-dashboard.is-low {
    color: #dc3545;
}

#current-called.is-expired {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.mc-sticky-action {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    z-index: 100;
}

.mc-queue-item {
    border-left: 4px solid transparent;
    transition: border-color 0.2s ease;
}

.mc-queue-item.called {
    border-left-color: var(--mc-accent);
    background: #fff5f6;
}

.mc-queue-item.waiting {
    border-left-color: #ffc107;
}

.mc-step-num {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--mc-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.mc-alert-called {
    background: #d1e7dd;
    border: 2px solid #0f5132;
    border-radius: 1rem;
}

.mc-honeypot,
#hpc {
    display: none !important;
}

.mc-navbar {
    background: var(--mc-primary);
}

.mc-dashboard-body {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mc-dashboard-nav {
    flex-shrink: 0;
}

.mc-dashboard-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 0.75rem;
}

.mc-dashboard-row {
    height: 100%;
    min-height: 0;
    margin: 0;
}

.mc-dashboard-sidebar-col,
.mc-dashboard-queue-col {
    height: 100%;
    min-height: 0;
}

.mc-dashboard-sidebar {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mc-dashboard-controls {
    flex-shrink: 0;
}

.mc-dashboard-transfer .form-select {
    background-image: none;
    padding-right: 0.75rem;
}

.mc-dashboard-qr {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.mc-dashboard-queue-card {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mc-dashboard-queue-header {
    flex-shrink: 0;
}

.mc-dashboard-queue-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mc-qr-img-dashboard {
    max-width: 160px;
}

@media (max-width: 1199.98px) {
    .mc-dashboard-body {
        height: 100dvh;
        max-height: 100dvh;
    }

    .mc-dashboard-main {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mc-dashboard-row {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100%;
    }

    .mc-dashboard-sidebar-col {
        order: 1;
        flex: 0 0 auto;
        height: auto;
        max-height: none;
    }

    .mc-dashboard-queue-col {
        order: 2;
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
    }

    .mc-dashboard-sidebar {
        height: auto;
    }

    .mc-dashboard-controls {
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .mc-dashboard-qr {
        display: none !important;
    }
}

/* iPad / tablet landscape: keep controls and queue usable side by side from 992px up */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .mc-dashboard-main {
        overflow: hidden;
    }

    .mc-dashboard-row {
        flex-direction: row;
        flex-wrap: nowrap;
        height: 100%;
    }

    .mc-dashboard-sidebar-col {
        order: 0;
        flex: 0 0 340px !important;
        width: 340px !important;
        max-width: 340px !important;
        height: 100%;
        min-height: 0;
    }

    .mc-dashboard-queue-col {
        order: 0;
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        height: 100%;
        min-height: 0;
    }

    .mc-dashboard-sidebar {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mc-dashboard-controls {
        position: static;
    }
}

.mc-container-narrow {
    max-width: 480px;
}

.mc-dashboard-main.mc-main-scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mc-admin-page {
    max-width: 1100px;
    padding-bottom: 1rem;
}

.mc-analytics-bar {
    height: 0.65rem;
    background: #eee;
}

.mc-analytics-insight {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    height: 100%;
}

.mc-container-auth {
    max-width: 420px;
}

.mc-container-text {
    max-width: 540px;
}

/* Landing page */
.mc-landing-page {
    background: #f4f5f8;
}

.mc-public-nav {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.mc-public-brand-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.mc-landing-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 3rem 0 3.5rem;
}

.mc-landing-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(233, 69, 96, 0.22), transparent 60%),
        linear-gradient(165deg, var(--mc-primary) 0%, #16213e 55%, #0f3460 100%);
}

.mc-landing-hero-inner {
    max-width: 720px;
}

.mc-landing-logo {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.mc-landing-eyebrow {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mc-landing-title {
    font-size: clamp(1.85rem, 5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.mc-landing-lead {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
}

.mc-landing-btn-outline {
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
}

.mc-landing-btn-outline:hover,
.mc-landing-btn-outline:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: #fff;
}

.mc-landing-trust {
    color: rgba(255, 255, 255, 0.65);
}

.mc-landing-trust li::before {
    content: "✓ ";
    color: var(--mc-accent);
    font-weight: 700;
}

.mc-landing-section {
    background: #f4f5f8;
}

.mc-landing-section--alt {
    background: #fff;
}

.mc-landing-step .mc-step-num {
    display: inline-flex;
}

.mc-landing-code {
    font-size: 0.875em;
    color: var(--mc-accent);
    background: rgba(233, 69, 96, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
}

.mc-landing-feature-icon {
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0.75rem;
}

.mc-landing-feature {
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mc-landing-feature:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.mc-landing-cta {
    background: linear-gradient(160deg, var(--mc-primary) 0%, #16213e 100%);
    padding: 3.5rem 0;
}

.mc-public-footer {
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mc-public-footer a:hover {
    color: var(--mc-accent) !important;
}

.mc-login-body {
    min-height: 100vh;
    background: var(--mc-primary);
}

/* Auth pages (login) */
.mc-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    color: #fff;
}

.mc-auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(155deg, #1a1a2e 0%, #16213e 45%, #0f3460 100%);
    pointer-events: none;
}

.mc-auth-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(233, 69, 96, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(233, 69, 96, 0.08) 0%, transparent 40%);
}

.mc-auth-top {
    position: relative;
    z-index: 1;
    padding: 1rem 1.25rem;
}

.mc-auth-home-link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.mc-auth-home-link:hover {
    color: #fff;
}

.mc-auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 1rem 1.25rem 2rem;
}

.mc-auth-shell {
    width: 100%;
    max-width: 420px;
}

.mc-auth-shell--wide {
    max-width: 520px;
}

.mc-auth-main--register {
    align-items: flex-start;
    padding-top: 0.5rem;
}

@media (min-width: 768px) {
    .mc-auth-main--register {
        align-items: center;
        padding-top: 1rem;
    }
}

.mc-register-preview {
    background: linear-gradient(135deg, #f8f9fa 0%, #eef1f5 100%);
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
}

.mc-register-preview-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mc-muted);
    margin-bottom: 0.35rem;
}

.mc-register-preview-url {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--mc-primary);
    word-break: break-all;
    line-height: 1.45;
}

.mc-register-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.mc-register-legend {
    float: left;
    width: 100%;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--mc-accent);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.mc-auth-input-group .input-group-text {
    font-size: 0.8125rem;
    background: #f8f9fa;
    border-color: #dee2e6;
    color: var(--mc-muted);
}

.mc-auth-input-group .mc-auth-input {
    border-left: none;
}

.mc-auth-input-group:focus-within .input-group-text,
.mc-auth-input-group:focus-within .mc-auth-input {
    border-color: var(--mc-accent);
}

.mc-auth-input-group:focus-within {
    box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 0.12);
    border-radius: 0.75rem;
}

.mc-auth-input-readonly {
    background-color: #f3f4f6;
    color: #495057;
    cursor: not-allowed;
}

.mc-field-feedback {
    min-height: 1.25rem;
}

.mc-auth-brand {
    margin-bottom: 1.5rem;
}

.mc-auth-logo {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    backdrop-filter: blur(4px);
}

.mc-auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.mc-auth-tagline {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9375rem;
    margin: 0;
}

.mc-auth-card {
    border-radius: 1.25rem;
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.25);
}

.mc-auth-card .card-body {
    color: #212529;
}

.mc-auth-input {
    border-radius: 0.75rem;
    border-color: #dee2e6;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.mc-auth-input:focus {
    border-color: var(--mc-accent);
    box-shadow: 0 0 0 0.2rem rgba(233, 69, 96, 0.15);
}

.mc-auth-password-wrap {
    position: relative;
}

.mc-auth-password-wrap .mc-auth-input {
    padding-right: 4.25rem;
}

.mc-auth-toggle-pw {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--mc-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.25rem 0.35rem;
    cursor: pointer;
    border-radius: 0.375rem;
}

.mc-auth-toggle-pw:hover {
    color: var(--mc-accent);
    background: rgba(233, 69, 96, 0.06);
}

.mc-auth-submit:disabled {
    opacity: 0.85;
}

.mc-auth-footer {
    margin-top: 1.75rem;
}

.mc-auth-footer .btn-mc-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.mc-auth-footer .btn-mc-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff;
}

.mc-turnstile-wrap {
    min-height: 65px;
}

.mc-turnstile-wrap .cf-turnstile {
    display: inline-block;
}

.mc-auth-legal {
    position: relative;
    z-index: 1;
    padding: 0 1rem 1.25rem;
}

.mc-qr-img {
    max-width: 320px;
}

.mc-qr-display-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.mc-qr-img-large {
    width: min(100%, 360px);
    height: auto;
    image-rendering: crisp-edges;
}

.mc-qr-scan-tips {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.mc-called-pulse {
    animation: mc-called-pulse 0.6s ease-in-out 3;
}

@keyframes mc-called-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(25, 135, 84, 0);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 24px rgba(25, 135, 84, 0.35);
    }
}

@media print {
    nav,
    footer,
    .btn,
    .mc-qr-scan-tips {
        display: none !important;
    }

    .mc-card {
        box-shadow: none !important;
        border: none !important;
    }

    .mc-qr-display-wrap {
        box-shadow: none !important;
        padding: 0 !important;
    }

    .mc-qr-img-large {
        width: 80mm !important;
        height: 80mm !important;
        max-width: none !important;
    }
}

@media (min-width: 768px) {
    .mc-landing-hero {
        padding: 5rem 0 5.5rem;
    }

    .mc-hero {
        padding: 5rem 0 6rem;
    }
}

.mc-display-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(165deg, var(--mc-primary) 0%, #16213e 55%, #0f3460 100%);
    color: #fff;
    overflow: hidden;
}

.mc-display-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.mc-display-inner {
    width: min(100%, 520px);
}

.mc-display-eyebrow {
    font-size: 0.875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

.mc-display-shop-name {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    font-weight: 700;
    color: #fff;
}

.mc-display-qr-wrap {
    background: #fff;
    border-radius: 1.25rem;
    padding: clamp(0.75rem, 3vw, 1.25rem);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}

.mc-display-qr-img {
    width: min(100%, 480px);
    height: auto;
    display: block;
    margin: 0 auto;
    image-rendering: crisp-edges;
}

.mc-display-hint {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.78);
}
