/* ==============================================
   GOOFY EATS ORDER TOOL — Design System & Styles
   Dark theme with Orange + Green accent
   Matching the reference Goofy Eats website
   ============================================== */

/* ── CSS Custom Properties ── */
:root {
    /* Brand Colors */
    --accent-orange: #f5a623;
    --accent-orange-bright: #ffbe45;
    --accent-orange-dark: #d4881a;
    --accent-green: #2ecc40;
    --accent-green-bright: #4dff6b;
    --accent-green-dark: #1ea532;

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, var(--accent-orange), var(--accent-green));
    --gradient-brand-reverse: linear-gradient(135deg, var(--accent-green), var(--accent-orange));
    --gradient-glow: linear-gradient(135deg, rgba(245, 166, 35, 0.4), rgba(46, 204, 64, 0.4));

    /* Backgrounds */
    --bg-primary: #080808;
    --bg-secondary: #0f0f0f;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(255, 255, 255, 0.04);
    --bg-input-focus: rgba(255, 255, 255, 0.07);
    --bg-navbar: rgba(8, 8, 8, 0.85);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(245, 166, 35, 0.2);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-input: rgba(255, 255, 255, 0.1);
    --border-input-focus: rgba(245, 166, 35, 0.4);

    /* Text */
    --text-primary: #f0f0f0;
    --text-secondary: rgba(240, 240, 240, 0.6);
    --text-tertiary: rgba(240, 240, 240, 0.4);

    /* Status Colors */
    --color-success: #2ecc40;
    --color-error: #ff4757;
    --color-warning: #f5a623;
    --color-info: #3498db;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --container-max: 560px;
    --container-padding: 0 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ── Background ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(245, 166, 35, 0.07) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* ── Background Glows ── */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(150px);
    pointer-events: none;
    z-index: 0;
}

.bg-glow-1 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.12) 0%, transparent 70%);
    top: -350px;
    left: -250px;
    animation: floatOrb1 12s ease-in-out infinite;
}

.bg-glow-2 {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(46, 204, 64, 0.08) 0%, transparent 70%);
    bottom: -250px;
    right: -200px;
    animation: floatOrb2 15s ease-in-out infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(60px, 40px); }
    66% { transform: translate(-30px, 60px); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-50px, -30px); }
    66% { transform: translate(40px, -50px); }
}

.bg-glow-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.06) 0%, rgba(46, 204, 64, 0.04) 50%, transparent 70%);
    top: 40%;
    right: -100px;
    animation: floatOrb3 18s ease-in-out infinite;
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-60px, -40px); }
}

/* ── Navbar ── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 14px 0;
    background: var(--bg-navbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.nav-logo-text {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: background var(--transition-medium);
}

.status-dot.offline {
    background: var(--color-error);
}

.status-dot.online {
    background: var(--color-success);
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(46, 204, 64, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(46, 204, 64, 0);
    }
}

/* ── Main Content ── */
.main-content {
    padding-top: 80px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Screens ── */
.screen {
    display: none;
    animation: fadeInScreen 0.4s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeInScreen {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Key Gate ── */
.key-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 24px;
}

.key-gate-card {
    position: relative;
    max-width: 440px;
    width: 100%;
    padding: 48px 40px;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    text-align: center;
    overflow: hidden;
    animation: slideUp 0.6s ease both;
}

.key-gate-glow {
    position: absolute;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 200px;
    background: var(--gradient-glow);
    filter: blur(80px);
    pointer-events: none;
    opacity: 0.4;
}

.key-gate-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: rgba(245, 166, 35, 0.08);
    border: 1px solid rgba(245, 166, 35, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-orange);
    position: relative;
}

.key-gate-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    position: relative;
}

.key-gate-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    position: relative;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-medium);
    white-space: nowrap;
    position: relative;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--gradient-brand);
    color: #000;
    box-shadow: 0 0 20px rgba(245, 166, 35, 0.2), 0 0 40px rgba(46, 204, 64, 0.1);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 30px rgba(245, 166, 35, 0.35), 0 0 60px rgba(46, 204, 64, 0.2);
    transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--border-card);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--accent-orange);
    background: rgba(245, 166, 35, 0.05);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Input Fields ── */
.input-group {
    margin-bottom: 20px;
    position: relative;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.input-field {
    width: 100%;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1.5px solid var(--border-input);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-medium);
    outline: none;
}

.input-field::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.input-field:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-input-focus);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.08), 0 0 20px rgba(245, 166, 35, 0.05);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── OTP Boxes ── */
.otp-boxes {
    display: flex;
    justify-content: center;
    gap: 14px;
}

.otp-box {
    width: 64px;
    height: 72px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    border: 1.5px solid var(--border-input);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all var(--transition-medium);
    caret-color: var(--accent-orange);
}

.otp-box::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

.otp-box:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.12), 0 0 24px rgba(245, 166, 35, 0.08);
    transform: translateY(-2px);
}

.otp-box.filled {
    border-color: var(--accent-green);
    background: rgba(46, 204, 64, 0.04);
}

@media (max-width: 400px) {
    .otp-boxes {
        gap: 10px;
    }
    .otp-box {
        width: 56px;
        height: 64px;
        font-size: 1.3rem;
    }
}

/* ── Progress Bar ── */
.progress-bar-container {
    max-width: 720px;
    margin: 0 auto 40px;
    padding: 0 24px;
    position: relative;
}

.progress-bar {
    position: absolute;
    top: 18px;
    left: 60px;
    right: 60px;
    height: 3px;
    background: var(--border-subtle);
    border-radius: 2px;
    z-index: 0;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: var(--gradient-brand);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-tertiary);
    transition: all var(--transition-medium);
}

.progress-step.active .step-circle {
    background: var(--gradient-brand);
    border-color: transparent;
    color: #000;
    box-shadow: 0 0 16px rgba(245, 166, 35, 0.3);
}

.progress-step.completed .step-circle {
    background: var(--accent-green);
    border-color: transparent;
    color: #000;
}

.step-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--transition-medium);
}

.progress-step.active .step-label {
    color: var(--accent-orange);
}

.progress-step.completed .step-label {
    color: var(--accent-green);
}

/* ── Step Panels ── */
.step-content-area {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 220px);
}

.step-panel {
    display: none;
    animation: fadeInStep 0.4s ease both;
    width: 100%;
}

.step-panel.active {
    display: block;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Step Cards ── */
.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: border-color var(--transition-medium);
}

.step-card:hover {
    border-color: var(--border-accent);
}

.step-card-header {
    padding: 36px 36px 0;
    text-align: center;
}

.step-icon-badge {
    font-size: 2.2rem;
    margin-bottom: 16px;
}

.step-icon-badge .material-symbols-outlined {
    font-size: 48px;
    background: linear-gradient(135deg, #F5A623, #2ECC40);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Gradient material icons for inline/choice contexts */
.choice-icon .material-symbols-outlined {
    font-size: 28px;
    background: linear-gradient(135deg, #F5A623, #2ECC40);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.radio-label .material-symbols-outlined {
    font-size: 18px;
    vertical-align: -4px;
    margin-right: 4px;
    background: linear-gradient(135deg, #F5A623, #2ECC40);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.review-label .material-symbols-outlined {
    font-size: 16px;
    vertical-align: -3px;
    margin-right: 3px;
    background: linear-gradient(135deg, #F5A623, #2ECC40);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.success-icon-big .material-symbols-outlined {
    font-size: 64px;
    background: linear-gradient(135deg, #F5A623, #2ECC40);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.step-subtitle {
    font-size: 0.92rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

.step-card-body {
    padding: 32px 36px;
}

.step-card-footer {
    padding: 0 36px 24px;
}

/* ── Info Banners ── */
.info-banner-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(46, 204, 64, 0.06);
    border: 1px solid rgba(46, 204, 64, 0.15);
    margin-bottom: 20px;
    font-size: 0.88rem;
    color: var(--accent-green);
    font-weight: 500;
}

.info-banner-inline.warning {
    background: rgba(245, 166, 35, 0.06);
    border-color: rgba(245, 166, 35, 0.15);
    color: var(--accent-orange);
}

/* ── Feature List ── */
.feature-list {
    margin-bottom: 28px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item svg {
    color: var(--accent-green);
    flex-shrink: 0;
}

/* ── Choice Cards ── */
.choice-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choice-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    cursor: pointer;
    transition: all var(--transition-medium);
    text-align: left;
    font-family: var(--font-family);
    color: var(--text-primary);
    width: 100%;
}

.choice-card:hover {
    border-color: var(--accent-orange);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(245, 166, 35, 0.1);
}

.choice-card.selected {
    border-color: var(--accent-green);
    background: rgba(46, 204, 64, 0.06);
    box-shadow: 0 0 20px rgba(46, 204, 64, 0.1);
}

.choice-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.choice-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.choice-title {
    font-size: 0.95rem;
    font-weight: 700;
}

.choice-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ── Order Summary Card ── */
.order-summary-card {
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    margin-bottom: 20px;
}

.order-summary-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-store-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.order-item-count {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 4px 12px;
    background: rgba(245, 166, 35, 0.08);
    border-radius: var(--radius-full);
    font-weight: 600;
    color: var(--accent-orange);
}

.order-items-list {
    padding: 8px 0;
    max-height: 300px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-item-name {
    font-size: 0.88rem;
    font-weight: 500;
}

.order-item-qty {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.order-item-custom {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    padding-left: 12px;
    border-left: 2px solid var(--border-subtle);
    margin-top: 4px;
}

.order-item-price {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-orange);
    flex-shrink: 0;
}

.order-summary-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.order-subtotal {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.95rem;
}

/* ── Order Review ── */
.order-review-card {
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    margin-bottom: 24px;
}

.review-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.review-row:last-child {
    border-bottom: none;
}

.review-row.highlight {
    background: rgba(245, 166, 35, 0.04);
}

.review-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.review-value {
    font-size: 0.92rem;
    font-weight: 600;
}

.review-row.highlight .review-value {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.1rem;
    font-weight: 800;
}

/* ── Address Results ── */
.address-results {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.address-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    cursor: pointer;
    transition: all var(--transition-medium);
}

.address-option:hover {
    border-color: var(--accent-orange);
    background: var(--bg-card-hover);
}

.address-option-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.address-option-subtitle {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* ── Radio Group ── */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1.5px solid var(--border-card);
    cursor: pointer;
    transition: all var(--transition-medium);
}

.radio-option:hover {
    border-color: var(--border-accent);
}

.radio-option input[type="radio"] {
    accent-color: var(--accent-orange);
    width: 16px;
    height: 16px;
}

.radio-option input[type="radio"]:checked + .radio-label {
    color: var(--text-primary);
}

.radio-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ── Success Card ── */
.success-card {
    text-align: center;
    padding: 60px 40px !important;
    border-color: rgba(46, 204, 64, 0.3) !important;
}

.success-icon-big {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease both;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ── Messages ── */
.error-message {
    font-size: 0.85rem;
    color: var(--color-error);
    font-weight: 500;
    padding: 8px 0;
    min-height: 20px;
}

.error-message:empty {
    display: none;
}

.success-message {
    font-size: 0.85rem;
    color: var(--color-success);
    font-weight: 500;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.success-message::before {
    content: '✓';
    font-weight: 700;
}

/* ── Inline Button Spinner ── */
.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(0, 0, 0, 0.2);
    border-top-color: #000;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.btn-outline .btn-spinner {
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-orange);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Toasts ── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 420px;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
    pointer-events: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.success {
    border-color: rgba(46, 204, 64, 0.3);
    color: var(--color-success);
}

.toast.error {
    border-color: rgba(255, 71, 87, 0.3);
    color: var(--color-error);
}

.toast.info {
    border-color: rgba(52, 152, 219, 0.3);
    color: var(--color-info);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ── Utilities ── */
.hidden {
    display: none !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .key-gate-card {
        padding: 36px 24px;
    }

    .key-gate-title {
        font-size: 1.5rem;
    }

    .step-card-header {
        padding: 28px 24px 0;
    }

    .step-card-body {
        padding: 24px;
    }

    .step-card-footer {
        padding: 0 24px 20px;
    }

    .step-title {
        font-size: 1.3rem;
    }

    .progress-steps {
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .step-label {
        font-size: 0.6rem;
    }

    .step-circle {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .nav-status {
        padding: 4px 10px;
    }

    .status-text {
        font-size: 0.72rem;
    }

    .toast {
        min-width: auto;
        max-width: calc(100vw - 48px);
        margin: 0 auto;
    }

    .toast-container {
        right: 12px;
        left: 12px;
        align-items: center;
    }
}

@media (max-width: 400px) {
    .progress-bar-container {
        padding: 0 12px;
    }

    .progress-bar {
        left: 30px;
        right: 30px;
    }

    .step-label {
        display: none;
    }
}

/* Mobile progress bar line fix */
@media (max-width: 768px) {
    .progress-bar {
        top: 15px;
        left: 36px;
        right: 36px;
    }
}
