/* Aegis Vitae Demo – Dark Theme (angepasst an Berater-Dashboard) */

:root {
    --demo-bg-deep: #0b0f19;
    --demo-bg-surface: #131b2e;
    --demo-bg-elevated: #1a2438;
    --demo-accent: #6366f1;
    --demo-accent-hover: #818cf8;
    --demo-accent-muted: rgba(99, 102, 241, 0.25);
    --demo-text: #f8fafc;
    --demo-text-muted: #94a3b8;
    --demo-text-dim: #64748b;
    --demo-border: rgba(99, 102, 241, 0.22);
    --demo-success: #34d399;
    --demo-warning: #fbbf24;
    --demo-error: #f87171;
    --demo-radius: 0.75rem;
    --demo-max-width: 56rem;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body.demo-body {
    background: var(--demo-bg-deep);
    color: var(--demo-text);
    font-family: 'Source Sans 3', system-ui, sans-serif;
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.demo-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.demo-header {
    background: var(--demo-bg-surface);
    border-bottom: 1px solid var(--demo-border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.demo-header-inner {
    max-width: var(--demo-max-width);
    margin: 0 auto;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.demo-brand-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.125rem;
    color: var(--demo-accent-hover);
    margin: 0;
}

.demo-brand-sub {
    font-size: 0.7rem;
    color: var(--demo-text-dim);
    margin: 0.125rem 0 0;
}

.demo-header-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.demo-counter {
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    background: var(--demo-bg-elevated);
    border: 1px solid var(--demo-accent-muted);
    color: #a5b4fc;
}

.demo-counter.warning {
    border-color: rgba(251, 191, 36, 0.45);
    color: var(--demo-warning);
}

.demo-counter.locked {
    border-color: rgba(248, 113, 113, 0.45);
    color: var(--demo-error);
}

.demo-workflow {
    max-width: var(--demo-max-width);
    margin: 0 auto;
    padding: 0 1rem 0.875rem;
}

.demo-progress-bar {
    height: 0.375rem;
    background: var(--demo-bg-elevated);
    border-radius: 9999px;
    overflow: hidden;
}

.demo-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--demo-accent), #a78bfa);
    transition: width 0.35s ease;
    width: 0%;
}

.demo-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.625rem;
}

.demo-step {
    font-size: 0.72rem;
    color: var(--demo-text-dim);
    text-align: center;
    padding: 0.375rem 0.25rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-step.active {
    color: #c7d2fe;
    border-color: var(--demo-accent-muted);
    background: rgba(99, 102, 241, 0.08);
}

.demo-step.done {
    color: var(--demo-success);
}

.demo-main {
    flex: 1;
    max-width: var(--demo-max-width);
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
    width: 100%;
}

.demo-landing {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.demo-landing-card {
    max-width: 36rem;
    text-align: center;
}

.demo-landing-kicker {
    color: var(--demo-accent-hover);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.demo-landing-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    color: var(--demo-text);
    margin: 0 0 1rem;
}

.demo-landing-lead {
    color: var(--demo-text-muted);
    margin-bottom: 1.5rem;
}

.demo-feature-list {
    text-align: left;
    font-size: 0.875rem;
    color: var(--demo-text-dim);
    list-style: none;
    padding: 0;
    margin: 0 auto 1.5rem;
    max-width: 22rem;
}

.demo-feature-list li {
    padding: 0.25rem 0;
}

.demo-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    margin-bottom: 1.25rem;
}

.demo-status-pill.ok {
    background: rgba(52, 211, 153, 0.12);
    color: var(--demo-success);
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.demo-status-pill.error {
    background: rgba(248, 113, 113, 0.1);
    color: var(--demo-error);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.demo-card {
    background: var(--demo-bg-surface);
    border: 1px solid var(--demo-border);
    border-radius: var(--demo-radius);
    padding: 1.25rem;
}

.demo-card + .demo-card {
    margin-top: 1rem;
}

.demo-card-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.05rem;
    color: #c7d2fe;
    margin: 0 0 0.75rem;
}

.demo-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .demo-grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.demo-input,
.input-field {
    width: 100%;
    background: var(--demo-bg-deep);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 0.5rem;
    padding: 0.625rem 0.75rem;
    color: var(--demo-text);
    font-size: 0.875rem;
}

.demo-input:focus,
.input-field:focus {
    outline: none;
    border-color: var(--demo-accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.demo-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.demo-btn-primary,
.demo-btn-secondary,
.demo-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1.125rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.demo-btn-primary {
    background: var(--demo-accent);
    color: #fff;
}

.demo-btn-primary:hover:not(:disabled) {
    background: var(--demo-accent-hover);
}

.demo-btn-secondary {
    background: transparent;
    color: var(--demo-text);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.demo-btn-secondary:hover:not(:disabled) {
    border-color: #94a3b8;
}

.demo-btn-ghost {
    background: transparent;
    color: var(--demo-text-muted);
    border: none;
    padding-left: 0;
    padding-right: 0;
}

.demo-btn-primary:disabled,
.demo-btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.demo-mode-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.demo-mode-btn.is-active,
.cards-mode-active,
.runes-mode-active {
    border-color: var(--demo-accent);
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.1);
}

.demo-drawn-list {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem;
    background: var(--demo-bg-deep);
}

.drawn-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    font-size: 0.8125rem;
}

.drawn-item:last-child {
    border-bottom: none;
}

.demo-status-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    background: var(--demo-bg-deep);
    border: 1px solid rgba(148, 163, 184, 0.18);
    margin-bottom: 1rem;
}

.demo-status-box.is-loading {
    border-color: var(--demo-accent-muted);
}

.demo-status-box.is-error {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(248, 113, 113, 0.06);
}

.demo-status-box.is-success {
    border-color: rgba(52, 211, 153, 0.35);
    background: rgba(52, 211, 153, 0.06);
}

.demo-status-text {
    font-size: 0.875rem;
    color: var(--demo-text-muted);
    margin: 0;
    flex: 1;
}

.demo-status-text strong {
    color: var(--demo-text);
}

.demo-spinner {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-top-color: var(--demo-accent);
    border-radius: 50%;
    animation: demo-spin 0.75s linear infinite;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.demo-spinner.hidden {
    display: none;
}

@keyframes demo-spin {
    to { transform: rotate(360deg); }
}

.demo-log {
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 0.75rem;
    color: var(--demo-text-dim);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
    max-height: 8rem;
    overflow-y: auto;
}

.demo-log-entry {
    display: flex;
    gap: 0.375rem;
}

.demo-log-entry.done { color: var(--demo-success); }
.demo-log-entry.active { color: #a5b4fc; }
.demo-log-entry.error { color: var(--demo-error); }

.demo-results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .demo-results-grid {
        grid-template-columns: 1fr 1fr;
    }
    .demo-results-grid .demo-result-panel--wide {
        grid-column: 1 / -1;
    }
}

.demo-result-panel {
    background: var(--demo-bg-deep);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 8rem;
    max-height: 18rem;
}

.demo-result-panel-head {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #a5b4fc;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(99, 102, 241, 0.06);
}

.demo-result-panel-body {
    padding: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--demo-text-muted);
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    flex: 1;
}

.demo-result-panel-body.empty {
    color: var(--demo-text-dim);
    font-style: italic;
}

.demo-link {
    color: var(--demo-accent-hover);
    text-decoration: none;
}

.demo-link:hover {
    text-decoration: underline;
}

.demo-hidden {
    display: none !important;
}

/* Paywall */
.demo-paywall {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.paywall-cta {
    display: block;
    border-radius: var(--demo-radius);
    padding: 1.25rem;
    border: 1px solid;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.paywall-cta-mobile {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(8, 47, 73, 0.35);
}

.paywall-cta-mobile:hover {
    background: rgba(8, 47, 73, 0.6);
}

.paywall-cta-box {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(69, 26, 3, 0.3);
}

.paywall-cta-box:hover {
    background: rgba(69, 26, 3, 0.5);
}

.demo-gate-card {
    max-width: 28rem;
    margin: 0 auto;
}

.demo-gate-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.demo-gate-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--demo-text-muted);
    line-height: 1.45;
    cursor: pointer;
}

.demo-gate-consent input {
    margin-top: 0.2rem;
    accent-color: var(--demo-accent);
}

.demo-gate-error {
    color: #fca5a5;
    font-size: 0.8125rem;
    margin: 0;
}
