/* # /app/static/styles.css */
:root {
    --bg: #0f141b;
    --surface: #19212b;
    --surface-soft: #222c38;
    --text: #e8eef7;
    --muted: #9cacbf;
    --border: #2f3b4b;
    --primary: #2ea6ff;
    --primary-strong: #1687df;
    --accent: #5fcb89;
    --danger: #db4f6d;
    --radius: 16px;
    --shadow: 0 18px 46px rgba(3, 8, 13, 0.55);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    color: var(--text);
    background: radial-gradient(circle at 15% 10%, #162637 0%, rgba(22, 38, 55, 0) 40%),
        radial-gradient(circle at 80% 20%, #1d2736 0%, rgba(29, 39, 54, 0) 35%),
        var(--bg);
    font-family: Manrope, "Segoe UI", sans-serif;
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(70px);
    pointer-events: none;
    opacity: 0.34;
    z-index: 0;
}

.bg-orb-a {
    width: 280px;
    height: 280px;
    left: -90px;
    top: 130px;
    background: #2a8bd9;
}

.bg-orb-b {
    width: 300px;
    height: 300px;
    right: -100px;
    top: 50px;
    background: #2d3e57;
}

.app-shell {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 18px 64px;
}

.hero {
    background: linear-gradient(120deg, rgba(46, 166, 255, 0.92), rgba(30, 74, 126, 0.94));
    border-radius: 24px;
    color: #fff;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.45s ease-out;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
}

.brand-text {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.78rem;
    opacity: 0.9;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.76rem;
    opacity: 0.84;
}

.hero h1 {
    margin: 8px 0 10px;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1.1;
}

.lead {
    margin: 0;
    max-width: 62ch;
    opacity: 0.95;
}

.hero-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.86rem;
    backdrop-filter: blur(3px);
}

.tabs {
    position: fixed;
    left: 18px;
    top: 18px;
    z-index: 20;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(10, 16, 24, 0.92);
    backdrop-filter: blur(8px);
    animation: fadeUp 0.5s ease-out;
}

.tab {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.93rem;
}

.tab.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.panel {
    display: none;
}

.panel.is-active {
    display: block;
    animation: fadeUp 0.4s ease-out;
}

.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

.card {
    grid-column: span 6;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(15, 26, 21, 0.06);
}

.card-wide {
    grid-column: span 12;
}

.card h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 1.08rem;
}

.help-tip {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #101821;
    color: var(--muted);
    display: inline-grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.help-tip:hover,
.help-tip:focus-visible {
    color: #fff;
    border-color: var(--primary);
}

.muted {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.93rem;
}

.card-head,
.toolbar,
.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.toolbar input {
    width: auto;
    min-width: 180px;
    flex: 1 1 220px;
}

label {
    display: block;
    margin-top: 10px;
    margin-bottom: 6px;
    font-size: 0.86rem;
    color: var(--muted);
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #111922;
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

.btn {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 9px 13px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-strong);
}

.btn:focus-visible,
.tab:focus-visible,
.lang-btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
.help-tip:focus-visible,
.key-value:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.btn-soft {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--border);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.kv-list {
    margin: 0;
}

.kv-list dt {
    color: var(--muted);
    font-size: 0.84rem;
    margin-top: 8px;
}

.kv-list dd {
    margin: 2px 0 8px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.95rem;
    word-break: break-word;
}

.stack {
    display: grid;
    gap: 10px;
}

.key-item,
.user-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: var(--surface-soft);
    display: grid;
    gap: 6px;
}

.location-flag {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    margin-right: 6px;
}

.key-meta,
.user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.84rem;
}

.key-value {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #101821;
    color: var(--text);
    font-family: "Space Grotesk", monospace;
    font-size: 0.84rem;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    cursor: pointer;
}

.plain-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.5;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 72px;
    z-index: 9999;
    transform: translateY(18px);
    opacity: 0;
    pointer-events: none;
    background: #0b1118;
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, opacity 0.2s ease;
    max-width: min(86vw, 460px);
}

.help-toast {
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 9999;
    transform: translateY(-18px);
    opacity: 0;
    pointer-events: none;
    background: #111922;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, opacity 0.2s ease;
    max-width: min(86vw, 460px);
    font-size: 0.9rem;
    line-height: 1.35;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(7, 12, 18, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    width: min(560px, 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(160deg, rgba(30, 45, 63, 0.96), rgba(17, 26, 36, 0.96));
    box-shadow: var(--shadow);
    padding: 18px;
}

.payment-price {
    border: 1px solid rgba(46, 166, 255, 0.35);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 10px 0 12px;
    background: linear-gradient(135deg, rgba(46, 166, 255, 0.18), rgba(95, 203, 137, 0.12));
}

.payment-price-label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.payment-price-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-price-value {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.12rem;
    letter-spacing: 0.01em;
}

.payment-price-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2dcf7a, #1ea85f);
}

.payment-plan-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.payment-plan-btn {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.84rem;
    white-space: normal;
    line-height: 1.2;
}

.payment-plan-btn.is-active {
    border-color: var(--primary);
    background: rgba(46, 166, 255, 0.16);
    color: #fff;
}

.payment-price.is-changed {
    animation: priceFlash 0.65s ease-out;
}

@keyframes priceFlash {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 166, 255, 0.75);
        transform: scale(1);
    }
    40% {
        box-shadow: 0 0 0 10px rgba(46, 166, 255, 0);
        transform: scale(1.015);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 166, 255, 0);
        transform: scale(1);
    }
}

.help-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.card-wide-block {
    display: contents;
}

body.tabs-visible .app-shell {
    padding-top: 76px;
}

.lang-switch {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 15;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(10, 16, 24, 0.92);
    backdrop-filter: blur(8px);
}

.lang-btn {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
}

.lang-btn.is-active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 900px) {
    .card,
    .card-wide {
        grid-column: span 12;
    }

    .tabs {
        left: 10px;
        right: 10px;
        top: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

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