/* ══════════════════════════════════════════
   DECISIONFLIP — Master Stylesheet
   Theme: Dark neon · glass · psychology
   ══════════════════════════════════════════ */

/* ─── Custom Properties ─── */
:root {
    --bg-deep:      #080810;
    --bg-surface:   #0e0e1a;
    --bg-card:      rgba(18, 18, 36, 0.7);
    --bg-input:     rgba(22, 22, 44, 0.85);

    --accent:       #00e5ff;
    --accent-glow:  rgba(0, 229, 255, 0.25);
    --accent-dim:   #00838f;
    --accent2:      #7c4dff;
    --accent2-glow: rgba(124, 77, 255, 0.25);

    --text:         #e8eaf6;
    --text-soft:    #9fa4b8;
    --text-muted:   #5c5f73;

    --success:      #69f0ae;
    --danger:       #ff5252;

    --radius:       14px;
    --radius-sm:    8px;
    --radius-lg:    22px;
    --radius-pill:  50px;

    --glass-border: rgba(0, 229, 255, 0.08);
    --glass-bg:     rgba(14, 14, 26, 0.6);

    --font-display: 'Sora', system-ui, -apple-system, sans-serif;
    --font-body:    'Manrope', system-ui, -apple-system, sans-serif;

    --ease:         cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(0, 229, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(124, 77, 255, 0.04) 0%, transparent 50%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: #4df0ff; }

img { max-width: 100%; display: block; }

/* ─── Container ─── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════ */
.site-header {
    padding: 18px 0;
    position: relative;
    z-index: 10;
}

.site-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.site-header__icon {
    border-radius: 6px;
}

.site-header__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ══════════════════════════════════════════
   HERO
   ══════════════════════════════════════════ */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-soft);
    line-height: 1.3;
}

.hero__brand {
    display: block;
    font-size: clamp(2.4rem, 6vw, 3.6rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.hero__sub {
    font-size: 1.05rem;
    color: var(--text-soft);
    max-width: 520px;
    margin: 16px auto 0;
}

/* ══════════════════════════════════════════
   DECISION PANEL (glass card)
   ══════════════════════════════════════════ */
.decision-panel {
    max-width: 640px;
    margin: 0 auto 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 36px;
}

/* ─── Option row ─── */
.options-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.option-card {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.option-card:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.option-card:last-child:focus-within {
    border-color: var(--accent2);
    box-shadow: 0 0 20px var(--accent2-glow);
}

.option-card__label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.option-card__input {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 500;
    width: 100%;
    outline: none;
}

.option-card__input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s;
}

.char-count.near-limit {
    color: #ff9800;
}

.char-count.at-limit {
    color: #f44336;
}

/* ─── Mode toggle ─── */
.mode-toggle {
    display: flex;
    justify-content: center;
    margin: 24px auto 0;
    background: var(--bg-input);
    border-radius: var(--radius-pill);
    padding: 4px;
    max-width: 320px;
    border: 1px solid var(--glass-border);
}

.mode-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    white-space: nowrap;
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    box-shadow: 0 2px 16px var(--accent-glow);
}

.mode-btn:not(.active):hover {
    color: var(--text-soft);
}

/* ─── Form error ─── */
.form-error {
    display: none;
    text-align: center;
    color: var(--danger);
    font-size: 0.88rem;
    margin-top: 16px;
}

/* ─── Flip button ─── */
.flip-btn {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 24px auto 0;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: transform 0.2s var(--ease), box-shadow 0.2s;
    box-shadow: 0 4px 24px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.flip-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.12) 50%, transparent 60%);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.flip-btn:hover::after {
    transform: translateX(100%);
}

.flip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.flip-btn:active {
    transform: translateY(0) scale(0.97);
}

.flip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ══════════════════════════════════════════
   FLIP STAGE
   ══════════════════════════════════════════ */
.flip-stage {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 220px;
    perspective: 800px;
    margin: 0 auto 16px;
}

.flip-stage.active {
    display: flex;
}

.coin {
    width: 160px;
    height: 160px;
    position: relative;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    will-change: transform;
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    padding: 18px;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
}

.coin-front {
    background: linear-gradient(145deg, #0a2a42, #003040);
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px var(--accent-glow), inset 0 0 20px rgba(0, 229, 255, 0.08);
    color: var(--accent);
    transform: rotateX(0deg);
    -webkit-transform: rotateX(0deg);
    z-index: 2;
}

.coin-back {
    background: linear-gradient(145deg, #1a0e3e, #2a1860);
    border: 2px solid var(--accent2);
    box-shadow: 0 0 30px var(--accent2-glow), inset 0 0 20px rgba(124, 77, 255, 0.08);
    color: var(--accent2);
    transform: rotateX(180deg);
    -webkit-transform: rotateX(180deg);
}

/* Glow effects go on flip-stage, NOT on .coin — filter breaks preserve-3d */
.flip-stage.active .coin.flipping {
    /* no filter here */
}

.flip-stage.active.glow-spin {
    filter: drop-shadow(0 0 24px var(--accent-glow));
}

.flip-stage.active.glow-land {
    animation: land-pulse-stage 0.6s ease;
}

@keyframes land-pulse-stage {
    0%   { filter: drop-shadow(0 0 30px var(--accent-glow)); }
    50%  { filter: drop-shadow(0 0 60px var(--accent)) brightness(1.2); }
    100% { filter: drop-shadow(0 0 20px var(--accent-glow)); }
}

/* ══════════════════════════════════════════
   RESULT PANEL
   ══════════════════════════════════════════ */
.result-panel {
    display: none;
    text-align: center;
    max-width: 540px;
    margin: 0 auto 24px;
    animation: fadeSlideUp 0.5s var(--ease);
}

.result-panel.active {
    display: block;
}

.result-panel__text {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    font-weight: 800;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.result-panel__text.result-a {
    color: var(--accent);
    text-shadow: 0 0 24px var(--accent-glow);
}

.result-panel__text.result-b {
    color: var(--accent2);
    text-shadow: 0 0 24px var(--accent2-glow);
}

.result-panel__reflection {
    font-size: 1rem;
    color: var(--text-soft);
    font-style: italic;
    margin-bottom: 28px;
}

/* ─── Result actions ─── */
.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.result-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-input);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    color: var(--text-soft);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.result-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.result-btn--accent {
    background: linear-gradient(135deg, rgba(0,229,255,0.12), rgba(124,77,255,0.12));
    border-color: rgba(0,229,255,0.2);
    color: var(--accent);
}

.result-btn--accent:hover {
    background: linear-gradient(135deg, rgba(0,229,255,0.2), rgba(124,77,255,0.2));
}

.result-btn svg {
    flex-shrink: 0;
}

.share-feedback {
    display: none;
    font-size: 0.82rem;
    color: var(--success);
    margin-bottom: 12px;
}

.nudge-meter {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Insight box ─── */
.insight-box {
    display: none;
    text-align: center;
    max-width: 480px;
    margin: 0 auto 60px;
    padding: 20px 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(124, 77, 255, 0.12);
    border-radius: var(--radius);
    color: var(--text-soft);
    font-size: 0.95rem;
    font-style: italic;
}

.insight-box.active {
    display: block;
    animation: fadeSlideUp 0.6s var(--ease) 0.2s both;
}

/* ══════════════════════════════════════════
   HOW IT WORKS
   ══════════════════════════════════════════ */
.section-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text);
}

.how-section {
    padding: 60px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.step {
    text-align: center;
    padding: 28px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.step:hover {
    border-color: rgba(0, 229, 255, 0.15);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.step__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0,229,255,0.1), rgba(124,77,255,0.1));
    margin-bottom: 16px;
    color: var(--accent);
}

.step__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}

.step__text {
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.6;
}

.how-section__cta {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.how-section__cta a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ══════════════════════════════════════════
   FAQ
   ══════════════════════════════════════════ */
.faq-section {
    padding: 60px 0;
    max-width: 680px;
    margin: 0 auto;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.faq-item {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.faq-item:hover,
.faq-item[open] {
    border-color: rgba(0, 229, 255, 0.15);
}

.faq-item summary {
    padding: 16px 20px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-muted);
    transition: transform 0.3s, color 0.3s;
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item[open] summary::after {
    content: '−';
    color: var(--accent);
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-item p {
    padding: 0 20px 16px;
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.7;
}

/* ══════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 24px;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: fadeSlideUp 0.35s var(--ease);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) transparent;
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.modal__close:hover {
    color: var(--accent);
    background: rgba(0, 229, 255, 0.08);
}

.modal h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-right: 32px;
}

.modal h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin: 20px 0 8px;
}

.modal p {
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.7;
    margin-bottom: 8px;
}

.modal ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.modal li {
    font-size: 0.9rem;
    color: var(--text-soft);
    line-height: 1.7;
    margin-bottom: 4px;
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
.site-footer {
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.04);
    margin-top: 40px;
}

.site-footer__links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.site-footer__links a {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.site-footer__links a:hover { color: var(--accent); }

.site-footer__copy {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.site-footer__disclaimer {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 6px;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

/* ══════════════════════════════════════════
   LEGAL PAGES
   ══════════════════════════════════════════ */
.legal-page {
    padding: 48px 0 80px;
    max-width: 680px;
    margin: 0 auto;
}

.legal-page h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.legal-updated {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.legal-page h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent);
    margin: 28px 0 10px;
}

.legal-page p {
    font-size: 0.92rem;
    color: var(--text-soft);
    line-height: 1.7;
    margin-bottom: 12px;
}

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

.legal-page li {
    font-size: 0.92rem;
    color: var(--text-soft);
    line-height: 1.7;
    margin-bottom: 6px;
}

.legal-page a {
    color: var(--accent);
}

/* ══════════════════════════════════════════
   CONTACT PAGE
   ══════════════════════════════════════════ */
.contact-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 32px;
    margin: 24px 0;
}

.contact-card p {
    font-size: 0.92rem;
    color: var(--text-soft);
    margin-bottom: 12px;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.12);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 32px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255,255,255,0.04);
    color: var(--text-soft);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0,229,255,0.06);
    box-shadow: 0 4px 20px rgba(0,229,255,0.1);
    transform: translateY(-2px) scale(1.03);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 8px rgba(0,0,0,0.2);
}

.btn-primary svg,
.btn-secondary svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-primary:hover svg,
.btn-secondary:hover svg {
    transform: scale(1.15);
}

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 680px) {
    .options-row {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .decision-panel {
        padding: 24px 20px;
    }

    .hero {
        padding: 40px 0 28px;
    }

    .hero__brand {
        font-size: 2.2rem;
    }

    .result-actions {
        gap: 8px;
    }

    .result-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .modal {
        padding: 24px 20px;
    }

    .contact-actions {
        flex-direction: column;
    }
}

/* ══════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html { scroll-behavior: auto; }

    .flip-btn::after { display: none; }

    .coin.landed {
        animation: none;
    }
}
