/* ============================================
   WeKeepers — Refined minimalism stylesheet
   ============================================ */

/* --- Reset & base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* --- Theme tokens --- */
:root {
    /* Light theme (default) */
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-alt: #f4f4f5;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #09090b;
    --text-secondary: #52525b;
    --text-tertiary: #a1a1aa;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-bg: #eff6ff;
    --success: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.1), 0 8px 16px -8px rgba(0, 0, 0, 0.05);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #09090b;
        --surface: #18181b;
        --surface-alt: #27272a;
        --border: #27272a;
        --border-strong: #3f3f46;
        --text: #fafafa;
        --text-secondary: #a1a1aa;
        --text-tertiary: #71717a;
        --accent: #3b82f6;
        --accent-hover: #60a5fa;
        --accent-bg: rgba(59, 130, 246, 0.1);
        --success: #34d399;
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
        --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.6), 0 8px 16px -8px rgba(0, 0, 0, 0.3);
    }
}

/* --- Body & typography --- */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 6vw, 4rem); }
h2 { font-size: clamp(1.875rem, 4vw, 2.5rem); letter-spacing: -0.025em; }
h3 { font-size: 1.5rem; letter-spacing: -0.02em; }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
    line-height: 1.7;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 250, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
    .header {
        background: rgba(9, 9, 11, 0.8);
    }
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

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

.logo-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    font-size: 14px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--text);
}

@media (max-width: 720px) {
    .nav-links { display: none; }
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-alt);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-full {
    width: 100%;
}

/* --- Hero --- */
.hero {
    position: relative;
    padding: clamp(64px, 12vw, 140px) 0 clamp(48px, 8vw, 100px);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 60%, rgba(37, 99, 235, 0.05) 0%, transparent 50%);
}

@media (prefers-color-scheme: dark) {
    .hero-bg {
        background:
            radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
            radial-gradient(circle at 80% 60%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 28px;
    letter-spacing: -0.005em;
}

.hero-eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.25rem);
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 24px;
    font-weight: 800;
}

.hero p {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 40px;
    line-height: 1.55;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Section --- */
.section {
    padding: clamp(60px, 10vw, 110px) 0;
}

.section-eyebrow {
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto clamp(40px, 6vw, 64px);
}

.section-head h2 {
    margin-bottom: 14px;
}

.section-head p {
    font-size: 1.0625rem;
}

/* --- Feature grid --- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: all 0.2s ease;
}

.feature:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-bg);
    color: var(--accent);
    display: grid;
    place-items: center;
    margin-bottom: 20px;
}

.feature h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
    letter-spacing: -0.015em;
}

.feature p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* --- Tariffs --- */
.tariffs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.tariff {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.tariff:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tariff.tariff-featured {
    border-color: var(--accent);
    border-width: 2px;
}

.tariff.tariff-featured:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.tariff-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 999px;
}

.tariff-period {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
    margin-bottom: 16px;
}

.tariff-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 6px;
}

.tariff-price-amount {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.04em;
    line-height: 1;
}

.tariff-price-currency {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.tariff-perdiem {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

.tariff-savings {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
    .tariff-savings {
        background: rgba(52, 211, 153, 0.15);
    }
}

.tariff-features {
    list-style: none;
    margin-bottom: 24px;
    flex: 1;
}

.tariff-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    padding: 6px 0;
}

.tariff-features svg {
    flex-shrink: 0;
    color: var(--accent);
}

.tariff .btn {
    margin-top: auto;
}

/* --- CTA Section --- */
.cta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: clamp(48px, 8vw, 80px) clamp(24px, 5vw, 56px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 60%);
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .cta::before {
        background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.12), transparent 60%);
    }
}

.cta h2 {
    margin-bottom: 16px;
    position: relative;
}

.cta p {
    font-size: 1.0625rem;
    max-width: 480px;
    margin: 0 auto 32px;
    position: relative;
}

.cta-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}

/* --- Legal / long-form --- */
.legal {
    padding: 60px 0 100px;
}

.legal h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.legal-meta {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.legal h2 {
    font-size: 1.375rem;
    margin: 48px 0 16px;
    letter-spacing: -0.02em;
}

.legal h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 32px 0 12px;
    letter-spacing: -0.01em;
}

.legal p, .legal li {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.legal ul {
    padding-left: 22px;
    margin-bottom: 14px;
}

.legal ul li {
    margin-bottom: 6px;
}

.legal strong {
    color: var(--text);
    font-weight: 600;
}

/* --- Contacts --- */
.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    max-width: 480px;
    margin: 40px auto 0;
}

.contact-card h3 {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 20px;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    color: var(--text);
    transition: all 0.15s ease;
}

.contact-email:hover {
    background: var(--accent-bg);
    color: var(--accent);
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 40px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-bottom {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.footer-mail {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* --- Utilities --- */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

/* --- Responsive --- */
@media (max-width: 640px) {
    .hero-actions { flex-direction: column; align-items: stretch; }
    .hero-actions .btn { width: 100%; }
    .footer-top { flex-direction: column; align-items: flex-start; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ===========================
   Auth pages (login, cabinet)
   =========================== */

:root {
    --ok: #16a34a;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 48px 0;
}

.auth-container {
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px;
}

.auth-title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.5;
}

.auth-subtitle strong {
    color: var(--text);
    font-weight: 600;
}

.auth-subtitle a {
    color: var(--accent);
    text-decoration: none;
}

.auth-subtitle a:hover {
    text-decoration: underline;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    font-size: 16px;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-input-code {
    text-align: center;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 26px;
    letter-spacing: 0.16em;
    font-weight: 600;
}

.auth-error {
    padding: 10px 12px;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.24);
    border-radius: 8px;
    color: #dc2626;
    font-size: 13px;
}

.auth-hint {
    margin: 18px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

.auth-hint a {
    color: var(--accent);
    text-decoration: none;
}

.auth-hint a:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    margin-top: 4px;
}

.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===========================
   Cabinet
   =========================== */

.cabinet-container {
    padding: 48px 0 64px;
    max-width: 720px;
}

.cabinet-loading {
    text-align: center;
    padding: 80px 0;
    color: var(--muted);
}

.spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 16px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.cabinet-header {
    margin-bottom: 28px;
}

.cabinet-header h1 {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cabinet-email {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.cabinet-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

.cabinet-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.cabinet-card-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cabinet-card-line {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.5;
}

.cabinet-muted {
    color: var(--muted);
}

.cabinet-muted.small {
    font-size: 13px;
}

.cabinet-section-title {
    margin: 28px 0 14px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.cabinet-actions {
    margin-bottom: 24px;
}

.cabinet-key {
    margin-bottom: 24px;
}

.cabinet-label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.cabinet-copy {
    display: flex;
    gap: 8px;
}

.cabinet-copy input {
    flex: 1;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 13px;
    color: var(--text);
    box-sizing: border-box;
}

.cabinet-qr {
    text-align: left;
}

.qr-box {
    display: inline-block;
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    line-height: 0;
}

.qr-box canvas {
    display: block;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-ok {
    background: rgba(22, 163, 74, 0.12);
    color: var(--ok);
}

.badge-muted {
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
}

.nav-logout {
    color: var(--muted) !important;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg);
}

/* Mobile */
@media (max-width: 560px) {
    .auth-card,
    .cabinet-card {
        padding: 24px 20px;
        border-radius: 14px;
    }
    .auth-input-code {
        font-size: 22px;
    }
}

/* ===========================
   Banners (payment results)
   =========================== */

.tariff-banner {
    margin: 0 0 28px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.tariff-banner-ok {
    background: rgba(22, 163, 74, 0.10);
    border: 1px solid rgba(22, 163, 74, 0.30);
    color: #166534;
}

.tariff-banner-warn {
    background: rgba(234, 179, 8, 0.10);
    border: 1px solid rgba(234, 179, 8, 0.30);
    color: #854d0e;
}

.tariff-banner a {
    color: inherit;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .tariff-banner-ok {
        background: rgba(22, 163, 74, 0.15);
        color: #86efac;
    }
    .tariff-banner-warn {
        background: rgba(234, 179, 8, 0.15);
        color: #fde68a;
    }
}
