/* ═══ CRYPTO SITUATION — Dark Cyan Theme ═══ */
:root {
    --bg-primary: #060b14;
    --bg-secondary: #0c1220;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --bg-input: #0f172a;
    --accent: #00d4ff;
    --accent-dim: #0099cc;
    --accent-glow: rgba(0, 212, 255, 0.15);
    --accent-glow-strong: rgba(0, 212, 255, 0.3);
    --green: #10b981;
    --green-dim: rgba(16, 185, 129, 0.15);
    --red: #ef4444;
    --red-dim: rgba(239, 68, 68, 0.15);
    --yellow: #f59e0b;
    --yellow-dim: rgba(245, 158, 11, 0.15);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-dim: #64748b;
    --border: #1e293b;
    --border-accent: rgba(0, 212, 255, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(ellipse at 20% 0%, rgba(0, 212, 255, 0.06) 0%, transparent 50%), radial-gradient(ellipse at 80% 100%, rgba(0, 153, 204, 0.04) 0%, transparent 50%); pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; min-height: 100vh; }

/* HEADER */
.header { display: flex; align-items: center; padding: 12px 16px; background: rgba(6, 11, 20, 0.85); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-back { background: none; border: none; color: var(--accent); cursor: pointer; padding: 4px; display: flex; align-items: center; }
.header-title { flex: 1; text-align: center; font-size: 16px; font-weight: 600; letter-spacing: 0.5px; }
.header-spacer { width: 32px; }
.hidden { display: none !important; }

/* PAGES */
.page { display: none; animation: pageIn 0.3s ease; padding-bottom: 24px; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.page-content { padding: 20px 16px; }
.page-title { font-size: 24px; font-weight: 700; margin-bottom: 20px; }
.page-subtitle { color: var(--text-secondary); margin-bottom: 20px; font-size: 14px; }

/* HOME */
.home-hero { padding: 40px 16px 20px; text-align: center; }
.logo-container { position: relative; margin-bottom: 20px; }
.logo-glow { position: absolute; width: 120px; height: 120px; top: 50%; left: 50%; transform: translate(-50%, -55%); background: radial-gradient(circle, var(--accent-glow-strong), transparent 70%); border-radius: 50%; animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.5; transform: translate(-50%, -55%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -55%) scale(1.15); } }
.logo-img { position: relative; width: 100px; height: auto; margin-bottom: 12px; }
.brand-tagline { color: var(--text-secondary); font-size: 13px; }

.rate-mini { display: flex; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 20px; margin-top: 20px; cursor: pointer; }
.rate-mini:active { border-color: var(--border-accent); }
.rate-mini-item { flex: 1; text-align: center; }
.rate-mini-divider { width: 1px; background: var(--border); margin: 0 16px; }
.rate-label { display: block; font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.rate-value { font-size: 18px; font-weight: 700; color: var(--accent); }

.home-actions { padding: 0 16px; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.home-extra { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

/* BUTTONS */
.btn-primary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 24px; background: linear-gradient(135deg, var(--accent-dim), var(--accent)); color: #060b14; font-size: 15px; font-weight: 600; border: none; border-radius: var(--radius); cursor: pointer; text-decoration: none; }
.btn-primary:active { transform: scale(0.97); }
.btn-glow { box-shadow: var(--shadow-glow); }
.btn-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 13px; font-weight: 500; cursor: pointer; }
.btn-card:active { border-color: var(--border-accent); background: var(--bg-card-hover); }
.btn-outline { width: 100%; padding: 14px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-primary); font-size: 14px; cursor: pointer; }
.btn-outline:active { border-color: var(--border-accent); background: var(--accent-glow); }
.btn-ghost { display: block; width: 100%; padding: 14px; background: none; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-secondary); font-size: 14px; cursor: pointer; margin-top: 12px; }
.btn-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-copy { padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--accent); font-size: 12px; cursor: pointer; white-space: nowrap; }

/* EXCHANGE TABS */
.exchange-tabs { display: flex; background: var(--bg-card); border-radius: var(--radius); padding: 4px; margin-bottom: 20px; border: 1px solid var(--border); }
.tab { flex: 1; padding: 10px; background: none; border: none; color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer; border-radius: var(--radius-sm); letter-spacing: 0.5px; }
.tab.active { background: var(--accent); color: var(--bg-primary); }

/* CALCULATOR */
.calculator { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 24px; }
.calc-input-group { margin-bottom: 4px; }
.calc-input-group label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.calc-input-wrap { display: flex; align-items: center; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 16px; }
.calc-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.calc-input-wrap input { flex: 1; background: none; border: none; color: var(--text-primary); font-size: 24px; font-weight: 700; padding: 12px 0; outline: none; width: 100%; }
.calc-input-wrap input::placeholder { color: var(--text-dim); }
.calc-currency { color: var(--text-dim); font-size: 14px; font-weight: 600; }
.calc-arrow { display: flex; justify-content: center; padding: 8px 0; color: var(--accent); }
.calc-rate { text-align: center; font-size: 13px; color: var(--text-secondary); margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.calc-rate span { color: var(--accent); font-weight: 600; }

/* FORM FIELDS — увеличенные */
.form-section { margin-bottom: 16px; }
.form-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.input-group { position: relative; margin-bottom: 16px; }
.input-group input { width: 100%; padding: 18px 16px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 16px; outline: none; }
.input-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-group label { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 14px; pointer-events: none; transition: all 0.3s; }
.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label { top: 10px; transform: none; font-size: 10px; color: var(--accent); letter-spacing: 0.5px; text-transform: uppercase; }
.input-hint { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--text-dim); }

/* CHECKBOX — ПРАВИЛЬНОЕ выравнивание */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 20px;
    -webkit-user-select: none;
    user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkmark {
    width: 20px; height: 20px; min-width: 20px; flex-shrink: 0;
    border: 2px solid var(--border); border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
}
.checkbox-label input:checked ~ .checkmark { background: var(--accent); border-color: var(--accent); }
.checkbox-label input:checked ~ .checkmark::after { content: '✓'; color: var(--bg-primary); font-size: 12px; font-weight: 700; }
.checkbox-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; flex: 1; }
.checkbox-text a { color: var(--accent); text-decoration: underline; }

/* RATE PAGE */
.rate-cards { display: flex; gap: 12px; margin-bottom: 20px; }
.rate-card { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; text-align: center; }
.rate-card.buy { border-color: rgba(16, 185, 129, 0.3); }
.rate-card.sell { border-color: rgba(239, 68, 68, 0.3); }
.rate-card-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.rate-card-value { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.rate-card.buy .rate-card-value { color: var(--green); }
.rate-card.sell .rate-card-value { color: var(--red); }
.rate-card-currency { font-size: 11px; color: var(--text-dim); }
.rate-updated { text-align: center; font-size: 12px; color: var(--text-dim); margin-bottom: 20px; }

.info-box { padding: 14px 16px; background: var(--accent-glow); border: 1px solid var(--border-accent); border-radius: var(--radius); margin-bottom: 20px; }
.info-box p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ORDERS */
.orders-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.order-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; }
.order-item:active { border-color: var(--border-accent); }
.order-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-item-id { font-size: 14px; font-weight: 600; }
.order-item-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-new { background: var(--accent-glow); color: var(--accent); }
.badge-paid { background: var(--green-dim); color: var(--green); }
.badge-awaiting { background: var(--yellow-dim); color: var(--yellow); }
.badge-confirming { background: rgba(99,102,241,0.15); color: #818cf8; }
.badge-completed { background: var(--green-dim); color: var(--green); }
.badge-cancelled { background: var(--red-dim); color: var(--red); }
.badge-expired { background: var(--red-dim); color: var(--text-dim); }
.order-item-amount { font-size: 16px; font-weight: 700; }
.order-item-date { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty-state p { margin-bottom: 20px; }

/* ORDER DETAIL */
.order-detail-header { text-align: center; margin-bottom: 24px; }
.order-detail-id { font-size: 14px; color: var(--text-dim); }
.order-detail-amount { font-size: 28px; font-weight: 800; color: var(--accent); }
.order-detail-sub { font-size: 13px; color: var(--text-dim); }
.detail-info { display: flex; flex-direction: column; gap: 4px; margin: 20px 0; }
.detail-row { display: flex; justify-content: space-between; padding: 12px 16px; background: var(--bg-card); border-radius: var(--radius-sm); }
.detail-row-label { font-size: 13px; color: var(--text-dim); }
.detail-row-value { font-size: 13px; font-weight: 600; text-align: right; max-width: 60%; word-break: break-all; }

/* TIMELINE */
.status-timeline { padding: 0 0 0 32px; margin: 24px 0; position: relative; }
.timeline-item { position: relative; padding: 0 0 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--border); border: 2px solid var(--bg-primary); z-index: 2; }
.timeline-item.active::before { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow-strong); }
.timeline-item.completed::before { background: var(--green); }
.timeline-item.error::before { background: var(--red); }
.timeline-item::after { content: ''; position: absolute; left: -19px; top: 18px; width: 2px; height: calc(100% - 12px); background: var(--border); }
.timeline-item:last-child::after { display: none; }
.timeline-label { font-size: 14px; font-weight: 500; }
.timeline-item:not(.active):not(.completed) .timeline-label { color: var(--text-dim); }

.wallet-copy { cursor: pointer; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: monospace; font-size: 12px; color: var(--accent); word-break: break-all; text-align: center; margin: 8px 0; }
.wallet-copy:active { border-color: var(--accent); }
.wallet-copy small { display: block; color: var(--text-dim); font-size: 10px; margin-top: 4px; font-family: inherit; }
.timer-display { text-align: center; font-size: 24px; font-weight: 700; color: var(--yellow); margin: 12px 0; }
.timer-label { text-align: center; font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }

/* SUPPORT / TEXT / REFERRAL */
.support-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 20px; text-align: center; margin-bottom: 16px; }
.support-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }
.text-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; white-space: pre-line; font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.referral-stats { display: flex; gap: 20px; margin-bottom: 24px; }
.stat { flex: 1; text-align: center; }
.stat-value { display: block; font-size: 24px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.referral-link-box { margin-bottom: 16px; }
.referral-link-box label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--accent); font-size: 12px; outline: none; }
.aml-result { padding: 16px; border-radius: var(--radius); margin-bottom: 16px; }
.aml-result.safe { background: var(--green-dim); border: 1px solid rgba(16, 185, 129, 0.3); }

/* TOAST / LOADING */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 24px; font-size: 14px; z-index: 1000; opacity: 0; transition: all 0.3s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }
