/* =========================================================================
   Hiromant Mini App — стили
   Стилистика: продолжение лендинга (cosmic gradient + gold + Cormorant/Inter)
   ========================================================================= */

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #e8e3d8;
    background:
        radial-gradient(ellipse 90% 50% at 25% 8%, rgba(108, 86, 168, 0.42) 0%, transparent 60%),
        radial-gradient(ellipse 80% 60% at 80% 90%, rgba(212, 168, 83, 0.22) 0%, transparent 60%),
        linear-gradient(180deg, #0a0820 0%, #15112e 50%, #0a0820 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

/* Звёздное поле через radial-gradient (как на лендинге) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 28% 67%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1.5px 1.5px at 47% 32%, rgba(255,236,180,0.6), transparent),
        radial-gradient(1px 1px at 64% 84%, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 78% 23%, rgba(255,236,180,0.55), transparent),
        radial-gradient(1.5px 1.5px at 89% 56%, rgba(255,255,255,0.55), transparent),
        radial-gradient(1px 1px at 8% 78%, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 35% 90%, rgba(255,236,180,0.4), transparent);
    animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.55; }
    100% { opacity: 1; }
}

/* === Layout === */
#app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 540px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 18px 22px 24px;
}

.screen.hidden { display: none; }

/* === Header === */
.hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(232, 227, 216, 0.08);
    min-height: 32px;
}

.hdr-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hdr-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a1635 0%, #0a0820 100%);
    border: 1px solid rgba(212, 168, 83, 0.45);
    display: grid;
    place-items: center;
    font-size: 16px;
    color: #d4a853;
}

.hdr-name {
    font-size: 14px;
    font-weight: 700;
    color: #f4ecd8;
}

.hdr-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(232, 227, 216, 0.75);
    letter-spacing: 0.02em;
}

.hdr-step {
    font-size: 11px;
    font-weight: 600;
    color: rgba(232, 227, 216, 0.5);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hdr-back {
    background: none;
    border: none;
    color: #d4a853;
    font-size: 22px;
    cursor: pointer;
    padding: 0 8px 0 0;
    line-height: 1;
}

.progress {
    display: flex;
    gap: 4px;
    flex: 1;
    max-width: 80px;
}

.progress-step {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: rgba(232, 227, 216, 0.15);
}

.progress-step.is-active {
    background: linear-gradient(90deg, #d4a853, #ecc77f);
}

/* === Content === */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.content--center {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.content--scroll {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* === Hero (S1) === */
.hero-wrap {
    width: 180px;
    height: 240px;
    border-radius: 16px;
    overflow: hidden;
    margin: 8px 0 16px;
    border: 1px solid rgba(212, 168, 83, 0.3);
    box-shadow:
        0 18px 40px -12px rgba(0, 0, 0, 0.55),
        0 0 36px -6px rgba(212, 168, 83, 0.32);
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === Typography === */
.title {
    font-family: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
    font-size: clamp(26px, 7vw, 32px);
    font-weight: 600;
    line-height: 1.15;
    color: #f4ecd8;
    margin-bottom: 6px;
}

.title-md {
    font-family: 'Inter', sans-serif;
    font-size: clamp(20px, 5.5vw, 24px);
    font-weight: 700;
    line-height: 1.2;
    color: #f4ecd8;
    margin-bottom: 4px;
}

.subtitle {
    font-size: clamp(14px, 4vw, 16px);
    font-weight: 400;
    line-height: 1.45;
    color: rgba(232, 227, 216, 0.75);
}

.subtitle strong {
    color: #f4ecd8;
    font-weight: 600;
}

.text-muted {
    font-size: 12px;
    color: rgba(232, 227, 216, 0.5);
    line-height: 1.5;
    margin-top: 8px;
}

.disclaimer {
    font-size: 11px;
    color: rgba(232, 227, 216, 0.4);
    margin-top: 24px;
    font-style: italic;
}

.link-small {
    font-size: 13px;
    color: rgba(212, 168, 83, 0.85);
    text-decoration: none;
    display: inline-block;
    margin-top: 4px;
}

.link-small:hover { color: #ecc77f; }

/* === Checkbox === */
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0 4px;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-mark {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1.5px solid rgba(212, 168, 83, 0.5);
    background: rgba(255, 255, 255, 0.04);
    display: grid;
    place-items: center;
    margin-top: 1px;
    transition: all 0.2s;
}

.checkbox input:checked + .checkbox-mark {
    background: linear-gradient(135deg, #ecc77f 0%, #c79643 100%);
    border-color: #d4a853;
}

.checkbox input:checked + .checkbox-mark::after {
    content: '';
    width: 11px;
    height: 6px;
    border-left: 2px solid #1a1230;
    border-bottom: 2px solid #1a1230;
    transform: rotate(-45deg) translate(1px, -1px);
}

.checkbox-label {
    font-size: 13px;
    line-height: 1.4;
    color: rgba(232, 227, 216, 0.85);
}

/* === Examples (S2) === */
.examples {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 8px 0 4px;
}

.example {
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    border: 1px solid rgba(232, 227, 216, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.example--good { border-color: rgba(74, 200, 120, 0.3); background: rgba(74, 200, 120, 0.06); }
.example--bad { border-color: rgba(220, 100, 100, 0.25); background: rgba(220, 100, 100, 0.04); }

.example-icon { font-size: 22px; margin-bottom: 6px; }
.example-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(232, 227, 216, 0.7);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* === Upload slot === */
.upload-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 320px;
    margin: 8px auto 4px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-empty,
.upload-filled,
.upload-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    gap: 8px;
    border-radius: 16px;
    border: 2px dashed rgba(212, 168, 83, 0.4);
    transition: border-color 0.2s, background 0.2s;
}

.upload-slot:active .upload-empty { border-color: rgba(212, 168, 83, 0.7); }

.upload-icon { font-size: 36px; opacity: 0.6; }
.upload-text { font-size: 14px; color: rgba(232, 227, 216, 0.65); line-height: 1.4; }

.upload-filled {
    border: 1px solid rgba(212, 168, 83, 0.4);
    background: #0a0820;
    padding: 0;
}

.upload-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.upload-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.upload-error {
    border: 2px solid rgba(220, 100, 100, 0.5);
    background: rgba(220, 100, 100, 0.08);
}

.upload-error-icon { font-size: 32px; }
.upload-error-title { font-size: 16px; font-weight: 700; color: #f4ecd8; }
.upload-error-reason { font-size: 14px; color: rgba(232, 227, 216, 0.85); line-height: 1.4; }
.upload-error-counter { font-size: 12px; color: rgba(232, 227, 216, 0.5); margin-top: 4px; }

.hidden { display: none !important; }

/* === Buttons === */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 18px clamp(20px, 5vw, 28px);
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(15px, 4vw, 16px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary {
    color: #1a1230;
    background:
        linear-gradient(180deg, rgba(255, 248, 215, 0.42) 0%, rgba(255, 248, 215, 0) 38%, rgba(0, 0, 0, 0.12) 100%),
        linear-gradient(90deg, #ecc77f 0%, #d09d52 38%, #b8842e 50%, #d09d52 62%, #ecc77f 100%);
    box-shadow:
        0 18px 40px -12px rgba(0, 0, 0, 0.45),
        0 12px 36px -10px rgba(212, 168, 83, 0.6),
        inset 0 2px 0 rgba(255, 248, 215, 0.55),
        inset 0 -2px 4px rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 220, 150, 0.3);
}

.btn--secondary {
    color: rgba(232, 227, 216, 0.85);
    background: transparent;
    border: 1px solid rgba(212, 168, 83, 0.3);
}

.btn--secondary:active {
    background: rgba(212, 168, 83, 0.08);
}

/* === Footer CTA === */
.footer-cta {
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cta-helper {
    font-size: 11px;
    color: rgba(232, 227, 216, 0.55);
    letter-spacing: 0.02em;
    text-align: center;
    line-height: 1.4;
    max-width: 320px;
}

/* === Bullets (S5) === */
.bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 8px 0;
}

.bullet {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(232, 227, 216, 0.9);
}

.bullet-icon { flex-shrink: 0; font-size: 16px; }

/* === Price block (S5) === */
.price-block {
    text-align: center;
    margin: 16px 0 8px;
    padding: 16px 0;
}

.price-old {
    font-family: 'Cormorant Garamond', serif;
    font-size: 18px;
    color: rgba(232, 227, 216, 0.4);
    text-decoration: line-through;
    margin-bottom: 6px;
}

.price-question {
    font-size: 17px;
    font-weight: 600;
    color: #d4a853;
}

/* === Input === */
.input-group {
    position: relative;
    margin: 4px 0;
}

.input {
    width: 100%;
    padding: 14px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #f4ecd8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 168, 83, 0.25);
    border-radius: 12px;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: border-color 0.2s, background 0.2s;
}

.input:focus {
    outline: none;
    border-color: rgba(212, 168, 83, 0.6);
    background: rgba(255, 255, 255, 0.06);
}

.input::placeholder {
    color: rgba(232, 227, 216, 0.3);
    font-weight: 400;
}

.input.error { border-color: rgba(220, 100, 100, 0.6); }

.input-error {
    color: #e88880;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.input.shake { animation: shake 0.4s; }

/* === Banner === */
.banner {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
}

.banner--success {
    background: rgba(74, 200, 120, 0.1);
    border: 1px solid rgba(74, 200, 120, 0.3);
    color: #b8e6c8;
}

/* === Hand badge (S4) === */
.hand-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.2) 0%, rgba(212, 168, 83, 0.08) 100%);
    border: 1px solid rgba(212, 168, 83, 0.4);
    color: #ecc77f;
    font-size: 13px;
    font-weight: 600;
    margin: 4px 0 16px;
    letter-spacing: 0.02em;
}

/* === Reading body === */
.reading {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.65;
    color: rgba(232, 227, 216, 0.9);
}

.reading p {
    margin-bottom: 16px;
}

.reading p:last-child {
    margin-bottom: 0;
}

.reading p.tease {
    font-style: italic;
    color: rgba(212, 168, 83, 0.8);
    border-left: 2px solid rgba(212, 168, 83, 0.4);
    padding-left: 14px;
    margin-top: 24px;
}

/* === Loader === */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
}

.loader-palm {
    width: 140px;
    height: 180px;
}

.loader-palm--two {
    width: 240px;
    height: 160px;
}

.loader-line {
    animation: lineFlow 2.5s linear infinite;
}

@keyframes lineFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -24; }
}

.loader-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 24px;
    font-weight: 600;
    color: #f4ecd8;
    text-align: center;
    margin-top: 8px;
}

.loader-hint {
    font-size: 14px;
    color: rgba(212, 168, 83, 0.85);
    text-align: center;
    min-height: 22px;
    transition: opacity 0.5s;
}

.loader-meta {
    font-size: 12px;
    color: rgba(232, 227, 216, 0.4);
    margin-top: 8px;
}

/* === Checkmark (S8, S9) === */
.checkmark-wrap {
    margin: 24px 0 20px;
}

.checkmark {
    width: 96px;
    height: 96px;
}

.checkmark-circle {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: checkCircle 0.7s ease-out 0.2s forwards;
}

.checkmark-path {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: checkPath 0.5s ease-out 0.7s forwards;
}

@keyframes checkCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes checkPath {
    to { stroke-dashoffset: 0; }
}

/* === Dev panel === */
.dev-panel {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 9999;
    pointer-events: none;
}

.dev-toggle {
    pointer-events: auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.dev-buttons {
    pointer-events: auto;
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 12px;
    max-width: 200px;
    backdrop-filter: blur(12px);
}

.dev-panel.is-open .dev-buttons {
    display: flex;
}

.dev-buttons button {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(212, 168, 83, 0.2);
    border: 1px solid rgba(212, 168, 83, 0.4);
    color: #ecc77f;
    border-radius: 6px;
    cursor: pointer;
}

.dev-buttons button:active {
    background: rgba(212, 168, 83, 0.4);
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    .loader-line { animation: none; }
    .checkmark-circle, .checkmark-path { animation: none; stroke-dashoffset: 0; }
}
