:root {
    --eddie-bg: #111417;
    --eddie-panel: rgba(25, 30, 34, 0.92);
    --eddie-panel-soft: rgba(33, 39, 44, 0.85);
    --eddie-border: rgba(255, 208, 92, 0.25);
    --eddie-border-strong: rgba(255, 208, 92, 0.65);
    --eddie-text: #f3f1ea;
    --eddie-muted: #9fa8ad;
    --eddie-gold: #ffd05c;
    --eddie-amber: #f59e0b;
    --eddie-red: #ff7b54;
    --eddie-green: #8de986;
    --eddie-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

html,
body {
    min-height: 100%;
    overscroll-behavior: none;
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.15), transparent 25%),
        radial-gradient(circle at bottom right, rgba(107, 114, 128, 0.2), transparent 30%),
        linear-gradient(180deg, #161a1d 0%, #0f1214 100%);
    color: var(--eddie-text);
    font-family: "Courier New", Courier, monospace;
}

body.eddie-shell {
    margin: 0;
}

.hidden {
    display: none !important;
}

.kicker {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--eddie-gold);
    font-size: 0.74rem;
    margin-bottom: 0.7rem;
}

.login-stage,
.mobile-gate {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-card,
.mobile-card {
    width: min(720px, 100%);
    background: var(--eddie-panel);
    border: 1px solid var(--eddie-border);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: var(--eddie-shadow);
    backdrop-filter: blur(14px);
}

.login-card {
    width: min(980px, 100%);
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1fr);
    gap: 2.25rem;
    align-items: center;
}

.login-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-art {
    width: 100%;
    max-width: 420px;
    height: auto;
    display: block;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-stack {
    margin-top: 1.5rem;
}

.login-copy h1 {
    margin: 0;
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    line-height: 0.95;
}

.login-subtitle {
    margin: 0.6rem 0 0;
    color: var(--eddie-gold);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.92rem;
}

.login-provider-divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.25rem 0 0;
    color: var(--eddie-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
}

.login-provider-divider::before,
.login-provider-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.brand-lockup,
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand-mark {
    width: 124px;
    height: 124px;
    object-fit: contain;
}

.brand-mark-small {
    width: 72px;
    height: 72px;
}

.mobile-mark {
    width: 160px;
    display: block;
    margin: 0 auto 1.5rem;
}

.login-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--eddie-muted);
    font-size: 0.9rem;
}

.terminal-alert {
    border-color: rgba(255, 123, 84, 0.35);
    background: rgba(96, 30, 15, 0.55);
}

.app-shell {
    padding: 1.5rem;
}

.topbar,
.hero-panel,
.panel,
.overlay-card {
    background: var(--eddie-panel);
    border: 1px solid var(--eddie-border);
    box-shadow: var(--eddie-shadow);
    backdrop-filter: blur(14px);
}

.topbar {
    border-radius: 28px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--eddie-border);
    background: rgba(255, 255, 255, 0.04);
}

.app-frame {
    display: grid;
    gap: 1.5rem;
}

.hero-panel {
    border-radius: 28px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1rem;
}

.hero-panel h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

.hero-status {
    border-radius: 22px;
    background: var(--eddie-panel-soft);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-lamp {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--eddie-amber);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.55);
    animation: pulse 1.8s infinite;
}

.status-label {
    margin: 0 0 0.4rem;
    color: var(--eddie-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
}

.stage-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.95fr;
    gap: 1.5rem;
}

.stage-column {
    display: grid;
    gap: 1.5rem;
    align-content: start;
}

.stage-column-side {
    position: sticky;
    bottom: 1.5rem;
    align-self: end;
    height: fit-content;
}

.panel {
    border-radius: 28px;
    padding: 1.4rem;
}

.hash-stage {
    min-height: calc(100vh - 3rem);
    display: grid;
    place-items: center;
}

.hash-panel {
    width: min(760px, 100%);
}

.hash-result {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-heading {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.panel-index {
    min-width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 208, 92, 0.18), rgba(255, 208, 92, 0.05));
    border: 1px solid var(--eddie-border);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: var(--eddie-gold);
}

.panel-heading h3,
.hero-status h3 {
    margin: 0;
}

.panel-heading p,
.hero-panel p,
.hero-status p {
    margin-bottom: 0;
    color: var(--eddie-muted);
}

.printer-textarea,
.form-control {
    border-radius: 18px;
    background: rgba(9, 12, 14, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--eddie-text);
}

.printer-textarea:focus,
.form-control:focus {
    background: rgba(9, 12, 14, 0.95);
    color: var(--eddie-text);
    border-color: var(--eddie-border-strong);
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.18);
}

.panel-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.helper-copy {
    color: var(--eddie-muted);
    font-size: 0.92rem;
}

.suggestion-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.suggestion-toggle .form-check-input {
    margin-top: 0.2rem;
}

.suggestion-toggle .form-check-label {
    display: grid;
    gap: 0.2rem;
}

.suggestion-copy {
    color: var(--eddie-muted);
    font-weight: 400;
}

.review-meta {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.review-meta .meta-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 0.85rem 1rem;
}

.plans-modal-shell {
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 24%),
        linear-gradient(180deg, #161a1d 0%, #0f1214 100%);
    color: var(--eddie-text);
}

.plans-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.5rem 0;
    border-bottom: 0;
}

.plans-modal-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.plans-modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
}

.plan-selection-banner {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 208, 92, 0.12), rgba(255, 208, 92, 0.04));
    border: 1px solid var(--eddie-border-strong);
}

.plan-selection-banner strong {
    color: var(--eddie-gold);
    font-size: 1.02rem;
}

.plan-selection-banner span {
    color: var(--eddie-text);
}

.plan-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.plan-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 1rem;
    cursor: pointer;
    opacity: 0.72;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.plan-card.selected {
    border-color: var(--eddie-border-strong);
    background: rgba(255, 208, 92, 0.1);
    transform: translateY(-4px);
    opacity: 1;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

.plan-card:not(.selected):hover {
    opacity: 0.9;
    border-color: rgba(255, 208, 92, 0.3);
}

.plan-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.plan-picker {
    margin: 0;
    font-weight: 700;
}

.plan-card-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--eddie-muted);
    font-size: 0.77rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.plan-card.selected .plan-card-status {
    background: rgba(255, 208, 92, 0.18);
    color: var(--eddie-gold);
}

.plan-card-instruction {
    min-height: 2.8rem;
    margin: 0 0 0.85rem;
    color: var(--eddie-muted);
    font-size: 0.92rem;
}

.plan-card.selected .plan-card-instruction {
    color: var(--eddie-text);
}

.plan-card .form-control[readonly] {
    background: rgba(9, 12, 14, 0.45);
    color: rgba(243, 241, 234, 0.72);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    cursor: pointer;
}

.plan-card.selected .form-control[readonly] {
    cursor: text;
}

.plan-body {
    min-height: 290px;
}

.printer-stack {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(248, 241, 225, 0.95), rgba(226, 217, 196, 0.98));
    color: #252019;
    min-height: 700px;
}

.printer-top {
    background: linear-gradient(180deg, #3b4046, #24292d);
    color: #f9f6ef;
    padding: 1rem 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.printer-lights {
    display: flex;
    gap: 0.45rem;
}

.printer-lights span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
}

.printer-lights span:first-child {
    background: var(--eddie-green);
    box-shadow: 0 0 10px rgba(141, 233, 134, 0.6);
}

.printer-paper {
    position: relative;
    min-height: 560px;
    max-height: 560px;
    overflow: auto;
    padding: 1.2rem;
    background:
        repeating-linear-gradient(180deg, rgba(37, 32, 25, 0.08) 0, rgba(37, 32, 25, 0.08) 1px, transparent 1px, transparent 28px),
        linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0.06));
}

.printer-paper::before,
.printer-paper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 14px;
    background:
        radial-gradient(circle, rgba(37, 32, 25, 0.35) 2px, transparent 3px) center top / 14px 28px repeat-y;
}

.printer-paper::before {
    left: 0;
}

.printer-paper::after {
    right: 0;
}

#printerFeed {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.7;
    margin: 0;
    padding: 0 1.4rem;
}

.printer-body {
    height: 88px;
    background: linear-gradient(180deg, #24292d, #161b1f);
    border-top: 1px solid rgba(0, 0, 0, 0.3);
}

.completion-bloom {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 208, 92, 0.1);
    border: 1px solid var(--eddie-border);
    text-align: center;
}

.chaos-inline {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(137, 35, 20, 0.18);
    border: 1px solid rgba(255, 123, 84, 0.4);
}

.chaos-inline-layout,
.error-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.1fr);
    gap: 1.5rem;
    align-items: center;
}

.chaos-inline-image,
.error-art {
    width: 100%;
    display: block;
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.chaos-inline-details {
    margin: 0;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(13, 16, 18, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--eddie-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.error-stage {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.error-card {
    width: min(1080px, 100%);
    background: var(--eddie-panel);
    border: 1px solid rgba(255, 123, 84, 0.35);
    border-radius: 28px;
    padding: 1.75rem;
    box-shadow: var(--eddie-shadow);
    backdrop-filter: blur(14px);
}

.error-headline {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.error-summary {
    color: var(--eddie-text);
    font-size: 1.02rem;
}

.error-detail-list {
    display: grid;
    gap: 0.85rem;
    margin: 1.25rem 0 0;
}

.error-detail-item {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2000;
}

.overlay-card {
    width: min(520px, calc(100vw - 2rem));
    border-radius: 28px;
    padding: 2rem;
    text-align: center;
}

.spinner-rig {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1.5rem;
}

.spinner-gear,
.spinner-gear-small {
    position: absolute;
    border-radius: 50%;
    border: 8px dotted rgba(255, 208, 92, 0.45);
    animation: rotate 6s linear infinite;
}

.spinner-gear {
    inset: 12px;
}

.spinner-gear-small {
    inset: 46px;
    animation-direction: reverse;
    border-width: 6px;
}

.spinner-scan {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border-top: 2px solid rgba(141, 233, 134, 0.9);
    animation: rotate 1.7s linear infinite;
}

.printer-launch .printer-paper {
    animation: paperFly 1.35s ease forwards;
}

.printer-launch .printer-body,
.printer-launch .printer-top {
    animation: printerDrop 1.4s 0.35s ease forwards;
}

.btn-warning {
    color: #1e1a12;
    font-weight: 700;
}

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

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

@keyframes paperFly {
    to {
        transform: translateY(-160%) scale(0.95);
        opacity: 0;
    }
}

@keyframes printerDrop {
    to {
        transform: translateY(180%) rotate(8deg);
        opacity: 0;
    }
}

@media (max-width: 1199.98px) {
    .stage-grid,
    .hero-panel {
        grid-template-columns: 1fr;
    }

    .plans-modal-header {
        flex-direction: column;
        align-items: stretch;
        padding-top: 1.25rem;
    }

    .plans-modal-actions {
        justify-content: stretch;
    }

    .stage-column-side {
        position: static;
        align-self: auto;
    }

    .plan-cards {
        grid-template-columns: 1fr;
    }

    .chaos-inline-layout,
    .error-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .login-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .login-art {
        max-width: 340px;
    }
}

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