:root {
    --bg:            #07080e;
    --bg-card:       #0d0e1b;
    --bg-elevated:   #131426;
    --accent:        #c8a43a;
    --accent-dim:    rgba(200, 164, 58, 0.08);
    --accent-glow:   rgba(200, 164, 58, 0.20);
    --text:          #ededf1;
    --text-mid:      #8c939f;
    --text-dim:      #878f9e;   /* FIX: was #3a4048 (~1.8:1 contrast) → now ~5.1:1 */
    --border:        rgba(255, 255, 255, 0.05);
    --border-mid:    rgba(255, 255, 255, 0.09);
    --border-accent: rgba(200, 164, 58, 0.28);
    --font-display:  'Cormorant Garant', Georgia, serif;
    --font-body:     'Outfit', Arial, sans-serif;
    --ease:          cubic-bezier(0.25, 0.1, 0.25, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 300;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ── Hero / Landing ─────────────────────────────────── */

.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    background:
        radial-gradient(ellipse 65% 50% at 50% -10%, rgba(200,164,58,.09) 0%, transparent 68%),
        var(--bg);
    animation: fadeUp .65s var(--ease) both;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 420px;
    width: 100%;
}

.logo {
    width: 96px;
    height: auto;
    margin-bottom: 32px;
    filter: drop-shadow(0 0 30px rgba(200,164,58,.38));
}

.logo--small {
    width: 52px;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 18px rgba(200,164,58,.28));
}

/* Subtle wordmark for status pages instead of full h1 */
.wordmark {
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 0.52em;
    padding-right: 0.52em; /* compensate last-letter gap */
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 28px;
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 10vw, 4.4rem);
    font-weight: 300;
    letter-spacing: 0.22em;
    line-height: 1;
    color: var(--text);
    text-transform: uppercase;
}

.tagline {
    margin-top: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.4em;
    padding-right: 0.4em; /* compensate last-letter gap */
    text-transform: uppercase;
    color: var(--text-dim);
}

.divider {
    width: 1px;
    height: 48px;
    background: linear-gradient(180deg, transparent, var(--accent), transparent);
    margin: 36px 0;
    opacity: 0.5;
}

/* ── Form ───────────────────────────────────────────── */

.join-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.join-form input[type="tel"] {
    width: 100%;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    outline: none;
    transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.join-form input[type="tel"]:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.join-form input[type="tel"]::placeholder {
    color: var(--text-dim);
}

.join-form button,
.btn-add {
    width: 100%;
    padding: 15px 20px;
    background: transparent;
    border: 1px solid var(--border-accent);
    border-radius: 3px;
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .25s var(--ease), color .25s var(--ease),
                border-color .25s var(--ease), opacity .2s;
}

.join-form button:hover,
.btn-add:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
}

.join-form button:active,
.btn-add:active {
    transform: scale(0.99);
}

/* Loading / disabled state — prevents double-submit */
.join-form button:disabled,
.btn-paid:disabled,
.btn-add:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Status pages ───────────────────────────────────── */

.status-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 24px 64px;
    background:
        radial-gradient(ellipse 60% 40% at 50% -5%, rgba(200,164,58,.05) 0%, transparent 60%),
        var(--bg);
    animation: fadeUp .5s var(--ease) both;
}

.status-card {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 40px 32px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    animation: fadeUp .45s .1s var(--ease) both;
}

.status-icon {
    font-size: 1.1rem;
    color: var(--accent);
    opacity: 0.65;
    letter-spacing: 0.3em;
}

h2 {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 300;
    letter-spacing: 0.12em;
    color: var(--text);
    text-transform: uppercase;
}

p {
    color: var(--text-mid);
    font-size: 0.88rem;
    line-height: 1.7;
    text-align: center;
    font-weight: 300;
}

p strong {
    color: var(--text);
    font-weight: 400;
}

.note {
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

.devices-count {
    margin-top: -6px;
}

/* ── Notice / confirmation ──────────────────────────── */
/* FIX: was .status-notice with no CSS — completely unstyled */

.status-notice {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: #7dba95;
    padding: 10px 16px;
    background: rgba(125, 186, 149, 0.08);
    border: 1px solid rgba(125, 186, 149, 0.22);
    border-radius: 3px;
    width: 100%;
    text-align: center;
    font-family: var(--font-body);
}

/* ── QR codes ───────────────────────────────────────── */

.qr-wrap {
    background: #fff;
    border-radius: 3px;
    padding: 14px;
    display: inline-block;
}

.qr-code {
    display: block;
    width: 210px;
    height: auto;           /* FIX: was height:210px — could distort non-square QRs */
    object-fit: contain;
}

.devices {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    width: 100%;
}

.device-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.device-card .qr-code {
    background: #fff;
    border-radius: 3px;
    padding: 12px;
}

.device-label {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    padding-right: 0.3em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ── Buttons ────────────────────────────────────────── */

.btn-back {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    transition: color .2s;
    margin-top: 4px;
}

.btn-back:hover {
    color: var(--text-mid);
}

.btn-add {
    display: block;
    text-decoration: none;
    text-align: center;
    margin-top: 4px;
}

/* ── Store links ────────────────────────────────────── */

.store-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.store-link {
    padding: 7px 13px;
    background: transparent;
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    color: var(--text-mid);
    text-decoration: none;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: border-color .2s, color .2s;
}

.store-link:hover {
    border-color: var(--border-accent);
    color: var(--text);
}

/* ── T-Bank button ──────────────────────────────────── */

.btn-tbank {
    display: block;
    width: 100%;
    padding: 13px 20px;
    background: #ffdd2d;
    border: 1px solid transparent;
    border-radius: 3px;
    color: #1a1a1a;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    transition: background .2s, transform .15s;
}

.btn-tbank:hover {
    background: #f5d200;
}

.btn-tbank:active {
    transform: scale(0.99);
}

/* ── Paid button ────────────────────────────────────── */

.btn-paid {
    width: 100%;
    padding: 15px 20px;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    border-radius: 3px;
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background .25s var(--ease), border-color .25s var(--ease), opacity .2s;
}

.btn-paid:hover {
    background: rgba(200, 164, 58, 0.14);
    border-color: var(--accent);
}

.btn-paid:active {
    transform: scale(0.99);
}

/* ── Pricing ────────────────────────────────────────── */

.pricing {
    width: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    overflow: hidden;
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    gap: 16px;
}

.pricing-row + .pricing-row {
    border-top: 1px solid var(--border);
}

.pricing-label {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-mid);
}

.pricing-price {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--accent);
    letter-spacing: 0.05em;
}

/* ── Payment QR ─────────────────────────────────────── */

.qr-wrap--payment {
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
}

.qr-code--payment {
    width: 280px;
    height: auto;
    display: block;
}

/* ── Device list ────────────────────────────────────── */

.device-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.device-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    gap: 12px;
    transition: background .15s;
}

.device-row:hover {
    background: var(--bg-elevated);
}

.device-row + .device-row {
    border-top: 1px solid var(--border);
}

.device-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-mid);
    letter-spacing: 0.04em;
}

.device-num {
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-dim);
    flex-shrink: 0;
    font-family: var(--font-body);
}

.device-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    color: var(--text-dim);
    cursor: pointer;
    text-decoration: none;
    transition: border-color .2s, color .2s, background .2s;
    flex-shrink: 0;
}

.btn-icon:hover {
    border-color: var(--border-accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.btn-icon svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── QR Modal ───────────────────────────────────────── */

.qr-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.qr-modal.is-open {
    display: flex;
}

.qr-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 8, 14, 0.88);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.qr-modal__inner {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-mid);
    border-radius: 4px;
    padding: 32px 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    animation: fadeUp .2s var(--ease) both;
}

.qr-modal__label {
    font-size: 0.68rem;
    letter-spacing: 0.38em;
    padding-right: 0.38em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.qr-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 6px;
    line-height: 1;
    transition: color .15s;
}

.qr-modal__close:hover {
    color: var(--text);
}

.qr-code--modal {
    width: 220px;
    height: auto;
}

/* ── Animations ─────────────────────────────────────── */

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

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 480px) {
    .qr-code { width: 180px; }
    .qr-code--payment { width: 240px; }
    .status-card { padding: 28px 20px; }
    h1 { letter-spacing: 0.15em; }
    .status-page { padding: 36px 20px 48px; }
}
