/* ═══════════════════════════════════════════
   Ayrora — Mobile-First Mystical Theme
   ═══════════════════════════════════════════ */

:root {
    --bg:        #0a0a1e;
    --bg2:       #14142b;
    --bg3:       #1c1c3a;
    --surface:   #1e1e3f;
    --border:    #2d2d5f;
    --gold:      #d4af37;
    --gold-dim:  #8a7320;
    --purple:    #9d4edd;
    --purple-dim:#5a189a;
    --pink:      #ff6ec7;
    --text:      #f0f0f5;
    --text-dim:  #b0b0c8;
    --text-faint:#6a6a8c;
    --green:     #06d6a0;
    --red:       #ef476f;
    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 8px 32px rgba(157, 78, 221, 0.15);
    --shadow-lg: 0 16px 48px rgba(157, 78, 221, 0.25);
    --font:      'Inter', -apple-system, sans-serif;
    --font-display: 'Cinzel', 'Playfair Display', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(157, 78, 221, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.08) 0%, transparent 40%);
    background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--purple); }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* ─── Layout ─── */
.wrap { max-width: 480px; margin: 0 auto; padding: 0 20px; }
.wrap-lg { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.text-center { text-align: center; }

/* ─── Typography ─── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.3; letter-spacing: 0.02em; }
h1 { font-size: 2rem; margin-bottom: 16px; }
h2 { font-size: 1.6rem; margin-bottom: 12px; }
h3 { font-size: 1.25rem; }
.subtitle { color: var(--text-dim); font-size: 1rem; line-height: 1.6; margin-bottom: 24px; }
.eyebrow { color: var(--gold); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; }

/* ─── Logo ─── */
.logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.05em;
}

/* ─── Header ─── */
.header {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(10, 10, 30, 0.9);
    backdrop-filter: blur(10px);
    z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.header-nav { display: flex; gap: 16px; align-items: center; }
.header-nav a { color: var(--text-dim); font-size: 0.9rem; }
.header-nav a:hover { color: var(--gold); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--purple-dim));
    color: #fff;
    box-shadow: 0 4px 16px rgba(157, 78, 221, 0.4);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(157, 78, 221, 0.6); color: #fff; }
.btn-gold {
    background: linear-gradient(135deg, var(--gold), #b8941f);
    color: #1a1a2e;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.4);
}
.btn-gold:hover { color: #1a1a2e; box-shadow: 0 6px 24px rgba(212, 175, 55, 0.6); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 18px 32px; font-size: 1.1rem; }
.btn-sm { padding: 10px 18px; font-size: 0.875rem; }

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.card-glow {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.08), rgba(212, 175, 55, 0.04));
    border: 1px solid rgba(157, 78, 221, 0.3);
    box-shadow: var(--shadow);
}

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--purple); }
.form-input::placeholder { color: var(--text-faint); }

/* ─── Hero ─── */
.hero {
    padding: 60px 0 40px;
    text-align: center;
    position: relative;
}
.hero-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.hero h1 {
    font-size: 2.4rem;
    background: linear-gradient(135deg, #fff 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Tarot Card ─── */
.tarot-card {
    width: 200px;
    height: 320px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--purple-dim), var(--bg3));
    border: 2px solid var(--gold);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}
.tarot-card-back {
    background: linear-gradient(135deg, #1a0a3a, #0a0a1e);
    background-image:
        radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 50%),
        repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.05) 0px, rgba(212, 175, 55, 0.05) 2px, transparent 2px, transparent 8px);
}
.tarot-card-back::before {
    content: '✦';
    font-size: 4rem;
    color: var(--gold);
    opacity: 0.6;
}
.tarot-card-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--gold);
    text-align: center;
    margin-top: 12px;
    font-weight: 600;
}
.tarot-card-symbol {
    font-size: 4rem;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.5));
}

/* ─── Card Reveal Animation ─── */
.card-flip {
    perspective: 1000px;
}
.card-flip-inner {
    transition: transform 0.8s;
    transform-style: preserve-3d;
}
.card-flip.flipped .card-flip-inner {
    transform: rotateY(180deg);
}
.card-front, .card-back-side {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
.card-back-side {
    transform: rotateY(180deg);
    position: absolute;
    top: 0;
    left: 0;
}

/* ─── Reading Layout ─── */
.reading-cards {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 24px 0;
}
.reading-cards .tarot-card {
    width: 110px;
    height: 180px;
    padding: 12px;
}
.reading-cards .tarot-card-symbol { font-size: 2rem; margin-bottom: 8px; }
.reading-cards .tarot-card-name { font-size: 0.75rem; }

/* ─── Pricing Cards ─── */
.pricing {
    display: grid;
    gap: 20px;
    margin-top: 32px;
}
.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 24px;
    text-align: center;
    position: relative;
    transition: all 0.2s;
}
.price-card.popular {
    border: 2px solid var(--gold);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.08), rgba(157, 78, 221, 0.08));
    transform: scale(1.02);
}
.price-card .badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--gold), #b8941f);
    color: #1a1a2e;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.price-card h3 { color: var(--gold); margin-bottom: 8px; }
.price-card .price {
    font-size: 2.4rem;
    font-weight: 800;
    margin: 12px 0 4px;
    color: var(--text);
}
.price-card .price-period {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 20px;
}
.price-card ul {
    list-style: none;
    text-align: left;
    margin: 20px 0;
}
.price-card ul li {
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    position: relative;
    padding-left: 24px;
}
.price-card ul li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--gold);
}
.price-card ul li:last-child { border-bottom: none; }

/* ─── Reading Type Cards (Dashboard) ─── */
.reading-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}
.reading-type-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.reading-type-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}
.reading-type-card .icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}
.reading-type-card .title {
    font-family: var(--font-display);
    color: var(--gold);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.reading-type-card .desc {
    font-size: 0.75rem;
    color: var(--text-faint);
}
.reading-type-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1rem;
}
.reading-type-card.locked { opacity: 0.6; }

/* ─── Bottom Nav (Mobile) ─── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 20, 43, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    justify-content: space-around;
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-faint);
    font-size: 0.7rem;
    padding: 4px 8px;
    text-decoration: none;
}
.bottom-nav a.active { color: var(--gold); }
.bottom-nav a .nav-icon { font-size: 1.4rem; }
body.has-nav { padding-bottom: 80px; }

/* ─── Alerts ─── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}
.alert-success { background: rgba(6, 214, 160, 0.15); color: var(--green); border: 1px solid rgba(6, 214, 160, 0.3); }
.alert-error { background: rgba(239, 71, 111, 0.15); color: var(--red); border: 1px solid rgba(239, 71, 111, 0.3); }
.alert-info { background: rgba(157, 78, 221, 0.15); color: var(--purple); border: 1px solid rgba(157, 78, 221, 0.3); }

/* ─── Loading ─── */
.loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Footer ─── */
.footer {
    padding: 30px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-faint);
    font-size: 0.85rem;
    margin-top: 60px;
}

/* ─── Stars Background Animation ─── */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}
.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ─── Desktop ─── */
@media (min-width: 768px) {
    .pricing { grid-template-columns: 1fr 1fr 1fr; }
    .reading-types { grid-template-columns: repeat(3, 1fr); }
    .hero h1 { font-size: 3rem; }
    .wrap { max-width: 600px; }
}

/* ─── Prevent overflow ─── */
html, body { overflow-x: hidden; }

/* The HTML hidden attribute must win over component display rules. */
[hidden] { display: none !important; }
