/* ============================================================
   ОБЩИЕ СТИЛИ
   ============================================================ */
* { box-sizing: border-box; }

:root {
    --c-1c-yellow: #FFD700;
    --c-1c-yellow-dark: #f5c800;
    --c-1c-black: #1a1a1a;
    --c-1c-gray-1: #2a2a2a;
    --c-1c-gray-2: #3a3a3a;
    --c-1c-gray-3: #666;
    --c-1c-gray-4: #a0a0a0;
    --c-1c-bg: #1e1e1e;
    --c-1c-bg-light: #fffbe6;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a1a;
}

/* ============================================================
   ЛЕНДИНГ — стильная главная
   ============================================================ */

body.layout-home {
    display: block;
    background: #0f0f10;
    color: #e8e8e8;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ---------- Декоративный фон ---------- */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 215, 0, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 215, 0, .04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 20%, #000 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 20%, #000 40%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    top: -20vh;
    left: 50%;
    width: 80vw;
    height: 80vh;
    transform: translateX(-50%);
    background: radial-gradient(
        ellipse at center,
        rgba(255, 215, 0, .12) 0%,
        rgba(255, 215, 0, .04) 30%,
        transparent 70%
    );
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Шапка ---------- */
.site-header {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    max-width: 1280px;
    margin: 0 auto;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: .65rem;
    text-decoration: none;
    color: #e8e8e8;
    font-weight: 700;
    letter-spacing: -.02em;
}
.site-logo .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #FFD700;
    color: #0f0f10;
    border-radius: 9px;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: -.04em;
}
.site-name {
    color: #e8e8e8;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 600;
    font-size: .8rem;
}

.site-nav { display: flex; gap: .75rem; align-items: center; }

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: .6rem 1.15rem;
    background: #FFD700;
    color: #0f0f10;
    border: 1px solid #FFD700;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: .88rem;
    letter-spacing: -.01em;
    transition: background .18s, transform .12s, box-shadow .18s;
}
.nav-btn:hover {
    background: #f5c800;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, .25);
}
.nav-btn.ghost {
    background: transparent;
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, .15);
}
.nav-btn.ghost:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .3);
    box-shadow: none;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    z-index: 2;
    max-width: 1080px;
    margin: 0 auto;
    padding: 5rem 2.5rem 4rem;
    text-align: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem 1rem;
    background: rgba(255, 215, 0, .08);
    border: 1px solid rgba(255, 215, 0, .25);
    border-radius: 999px;
    font-size: .82rem;
    color: #FFD700;
    font-weight: 600;
    letter-spacing: .02em;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp .7s ease .1s forwards;
}
.hero-eyebrow .dot {
    width: 6px;
    height: 6px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 10px #FFD700;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .6; transform: scale(.85); }
}

.hero-title {
    font-size: clamp(2.2rem, 5.5vw + .5rem, 4.5rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -.045em;
    margin: 0 0 1.75rem;
    color: #f5f5f5;
}
.hero-title .line {
    display: block;
    opacity: 0;
    transform: translateY(24px);
    animation: fadeUp .9s cubic-bezier(.22, 1, .36, 1) forwards;
}
.hero-title .line:nth-child(1) { animation-delay: .25s; }
.hero-title .line:nth-child(2) { animation-delay: .5s; }

.hero-title .accent {
    background: linear-gradient(120deg, #FFD700 0%, #ffe766 50%, #FFD700 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    display: inline-block;
}
.hero-title .accent::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -.1em;
    height: 3px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: center;
    animation: underline 1.1s ease .9s forwards;
}

.hero-title .big-num {
    font-size: 1.25em;
    display: inline-block;
    padding: 0 .12em;
    background: linear-gradient(180deg, #FFD700 0%, #f5c800 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 900;
    letter-spacing: -.05em;
}

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes underline { to { transform: scaleX(1); } }

.hero-lead {
    max-width: 560px;
    margin: 0 auto 2.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #a8a8a8;
    opacity: 0;
    animation: fadeUp .9s ease .85s forwards;
}

/* ---------- Кнопки ---------- */
.hero-actions {
    display: flex;
    gap: .85rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeUp .9s ease 1.05s forwards;
}

.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .95rem 1.75rem;
    background: #FFD700;
    color: #0f0f10;
    border: 1px solid #FFD700;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -.01em;
    transition: background .18s, transform .12s, box-shadow .18s;
}
.btn-hero:hover {
    background: #f5c800;
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(255, 215, 0, .3);
}
.btn-hero .arrow {
    display: inline-block;
    transition: transform .18s;
}
.btn-hero:hover .arrow { transform: translateX(3px); }

.btn-hero.ghost {
    background: transparent;
    color: #e8e8e8;
    border-color: rgba(255, 255, 255, .15);
}
.btn-hero.ghost:hover {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .3);
    box-shadow: none;
}

/* ---------- Мета под кнопками ---------- */
.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
    opacity: 0;
    animation: fadeUp .9s ease 1.3s forwards;
}
.meta-item { text-align: center; }
.meta-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #FFD700;
    letter-spacing: -.03em;
    line-height: 1;
}
.meta-label {
    font-size: .8rem;
    color: #7a7a7a;
    margin-top: .35rem;
    letter-spacing: .02em;
}
.meta-sep {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, .08);
}

/* ---------- Шаги ---------- */
.steps {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: 0 auto;
    padding: 5rem 2.5rem 6rem;
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 2.5rem;
    color: #e8e8e8;
    opacity: 0;
    animation: fadeUp .8s ease 1.5s forwards;
}
.section-title .section-num {
    font-size: .8rem;
    color: #FFD700;
    font-weight: 600;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.step {
    position: relative;
    padding: 1.75rem 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, .015) 100%);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 16px;
    transition: border-color .2s, transform .2s, background .2s;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp .9s cubic-bezier(.22, 1, .36, 1) forwards;
}
.step:nth-child(1) { animation-delay: 1.65s; }
.step:nth-child(2) { animation-delay: 1.75s; }
.step:nth-child(3) { animation-delay: 1.85s; }
.step:nth-child(4) { animation-delay: 1.95s; }

.step:hover {
    border-color: rgba(255, 215, 0, .35);
    background: linear-gradient(180deg, rgba(255, 215, 0, .06) 0%, rgba(255, 255, 255, .02) 100%);
    transform: translateY(-3px);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 215, 0, .1);
    color: #FFD700;
    border: 1px solid rgba(255, 215, 0, .3);
    border-radius: 10px;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: -.02em;
    margin-bottom: 1.1rem;
}
.step h3 {
    margin: 0 0 .5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f0f0f0;
    letter-spacing: -.015em;
}
.step p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.55;
    color: #8a8a8a;
}
.step code {
    background: rgba(255, 215, 0, .1);
    color: #FFD700;
    padding: .05rem .35rem;
    border-radius: 4px;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-size: .82em;
}

/* ---------- Футер ---------- */
.site-footer {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2.5rem;
    max-width: 1280px;
    margin: 0 auto;
    border-top: 1px solid rgba(255, 255, 255, .06);
    font-size: .85rem;
    color: #666;
}
.footer-left {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.footer-left .logo.small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #FFD700;
    color: #0f0f10;
    border-radius: 6px;
    font-weight: 800;
    font-size: .7rem;
    letter-spacing: -.03em;
}
.footer-right { color: #555; }

/* ============================================================
   LOGIN / VERIFY
   ============================================================ */
body.layout-login {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    padding: 1rem;
}

.card {
    background: var(--c-1c-bg-light);
    color: var(--c-1c-black);
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    margin: 1rem;
    border: 3px solid var(--c-1c-yellow);
    box-shadow: 0 10px 40px rgba(255, 215, 0, .25);
}
.card h1 {
    margin: 0 0 .5rem;
    font-size: 1.35rem;
    color: var(--c-1c-black);
    font-weight: 800;
    letter-spacing: -.02em;
}
.card .muted { color: var(--c-1c-gray-3); font-size: .9rem; margin: 0 0 1.5rem; }
.card label {
    display: block;
    margin-bottom: .4rem;
    font-size: .9rem;
    color: var(--c-1c-black);
    font-weight: 700;
}
.card input[type="tel"],
.card input[type="text"] {
    width: 100%;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    background: #fff;
    border: 2px solid var(--c-1c-black);
    border-radius: 8px;
    color: var(--c-1c-black);
    font-size: 1rem;
    transition: border-color .15s, box-shadow .15s;
}
.card input[type="tel"]:focus,
.card input[type="text"]:focus {
    outline: none;
    border-color: var(--c-1c-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, .35);
}
.card button,
.card .button {
    display: inline-block;
    width: 100%;
    padding: .75rem 1rem;
    background: var(--c-1c-yellow);
    color: var(--c-1c-black);
    border: 2px solid var(--c-1c-black);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.card button:hover,
.card .button:hover {
    background: var(--c-1c-yellow-dark);
    transform: translateY(-1px);
}
.card button:disabled {
    background: #e5e5e5;
    color: #999;
    border-color: #999;
    cursor: not-allowed;
    transform: none;
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.login-brand .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: var(--c-1c-yellow);
    color: var(--c-1c-black);
    border: 3px solid var(--c-1c-black);
    border-radius: 12px;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -.03em;
}

.corner-link {
    position: fixed;
    top: 1.25rem;
    left: 1.5rem;
    color: var(--c-1c-yellow);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    padding: .5rem .9rem;
    border: 2px solid var(--c-1c-yellow);
    border-radius: 8px;
    transition: background .15s, color .15s;
    z-index: 10;
}
.corner-link:hover { background: var(--c-1c-yellow); color: var(--c-1c-black); }

.phone-wrap {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--c-1c-black);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    margin-bottom: 1rem;
    transition: border-color .15s, box-shadow .15s;
}
.phone-wrap:focus-within {
    border-color: var(--c-1c-yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, .35);
}
.phone-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 .85rem;
    background: var(--c-1c-yellow);
    color: var(--c-1c-black);
    font-weight: 800;
    font-size: 1rem;
    border-right: 2px solid var(--c-1c-black);
}
.phone-wrap input {
    flex: 1;
    border: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
}

.status {
    margin-top: 1rem;
    font-size: .9rem;
    min-height: 1.2em;
    color: var(--c-1c-black);
    font-weight: 600;
}
.status.error { color: #b91c1c; }
.status.ok { color: #15803d; }

.alert {
    background: #fee2e2;
    color: #b91c1c;
    border: 2px solid #b91c1c;
    padding: .75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
    font-weight: 600;
}

/* ============================================================
   DASHBOARD
   ============================================================ */
body.layout-dashboard {
    display: flex;
    flex-direction: column;
    background: #f0f0f0;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, var(--c-1c-yellow) 0%, var(--c-1c-yellow-dark) 100%);
    padding: 1rem 2rem;
    border-bottom: 3px solid var(--c-1c-black);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    flex-shrink: 0;
}

.app-brand { display: flex; align-items: center; gap: 1rem; }
.app-brand .logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--c-1c-black);
    color: var(--c-1c-yellow);
    border-radius: 10px;
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -.05em;
}
.brand-text { line-height: 1.2; }
.brand-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--c-1c-black);
    letter-spacing: -.02em;
}
.brand-sub { font-size: .85rem; color: var(--c-1c-gray-1); opacity: .8; }

.app-user { display: flex; align-items: center; gap: 1rem; }
.user-phone { font-weight: 700; color: var(--c-1c-black); font-size: .95rem; }
.logout-btn {
    display: inline-flex;
    align-items: center;
    padding: .55rem 1.2rem;
    background: var(--c-1c-black);
    color: var(--c-1c-yellow);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    transition: background .15s;
}
.logout-btn:hover { background: #000; }

.app-main {
    flex: 1;
    padding: 1.5rem 2rem 2rem;
    max-width: 100%;
    width: 100%;
}

.status-bar {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    background: #fff;
    border: 2px solid var(--c-1c-black);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.status-item { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.status-label { color: var(--c-1c-gray-3); font-weight: 600; }
.status-value { font-weight: 700; }
.status-value.ok { color: #15803d; }
.status-value.empty { color: var(--c-1c-gray-4); font-style: italic; font-weight: 400; }

.modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
    gap: 1.25rem;
    align-content: start;
}

.module {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid var(--c-1c-black);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    transition: transform .15s, box-shadow .15s;
}
.module:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.12); }

.module-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, var(--c-1c-yellow) 0%, var(--c-1c-yellow-dark) 100%);
    border-bottom: 2px solid var(--c-1c-black);
}
.module-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--c-1c-black);
    color: var(--c-1c-yellow);
    border-radius: 8px;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: -.03em;
    flex-shrink: 0;
}
.module-head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--c-1c-black);
    line-height: 1.25;
    letter-spacing: -.01em;
}

.module-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: .85rem;
}
.module-hint { margin: 0; color: var(--c-1c-gray-3); font-size: .88rem; line-height: 1.5; }

.file-picker { position: relative; }
.file-picker input[type="file"] {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
}
.file-picker-label {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: #fafafa;
    border: 2px dashed #c0c0c0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: .9rem;
    color: var(--c-1c-gray-3);
    min-width: 0;
}
.file-picker-label:hover { border-color: var(--c-1c-yellow-dark); background: #fffbe6; }
.picker-icon { font-size: 1.1rem; flex-shrink: 0; }
.picker-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.picker-text.has-file { color: var(--c-1c-black); font-weight: 600; }

.btn-1c {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .75rem 1.5rem;
    background: #fff;
    color: var(--c-1c-black);
    border: 2px solid var(--c-1c-black);
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s, box-shadow .15s;
    align-self: flex-start;
    letter-spacing: -.01em;
}
.btn-1c:hover { background: #f0f0f0; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.btn-1c:active { transform: translateY(0); box-shadow: none; }
.btn-1c.primary { background: var(--c-1c-yellow); border-color: var(--c-1c-black); }
.btn-1c.primary:hover { background: var(--c-1c-yellow-dark); }
.btn-1c:disabled {
    background: #e5e5e5;
    color: #999;
    border-color: #bbb;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.module-status {
    font-size: .88rem;
    min-height: 1.2em;
    color: var(--c-1c-black);
    font-weight: 600;
}
.module-status.error { color: #b91c1c; }
.module-status.ok { color: #15803d; }

.loaded-file {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .9rem;
    background: #ecfdf5;
    border: 2px solid #15803d;
    border-radius: 8px;
    font-size: .85rem;
   