@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Nunito:wght@300;400;600;700;800&display=swap&font-display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Twilight Dawn Palette */
    --bg-twilight-start: #FFF5F7;
    /* Near white soft blush */
    --bg-twilight-mid: #FFEBF0;
    /* Very light warm pink */
    --bg-twilight-end: #FFDEE9;
    /* Gentle dawn pink */

    --text-midnight: #0a0a0a;
    /* Deep black for high contrast */
    --text-muted: #535C68;
    /* Softened slate grey */

    --accent-gold: #CCA300;
    /* Deep Rich Golden Yellow */
    --accent-gold-hover: #B38F00;
    /* Deeper gold for interaction */

    --accent-plum: #856B96;
    /* Soft Royal Plum */
    --accent-lilac: #BFA2DB;
    /* Gentle Lilac */

    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);

    --error-red: #E05D5D;
    --success-green: #20BF55;

    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Nunito', sans-serif;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    /* Simple solid background instead of expensive fixed gradient */
    background-color: var(--bg-twilight-start);
    color: var(--text-muted);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: #ffffff;
    /* Solid white background instead of expensive blurred glass */
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 4px 15px rgba(133, 107, 150, 0.05);
    /* Lighter shadow */
}

/* Typography Utility */
.gold-text {
    color: var(--accent-gold);
}

h1,
h2,
h3,
h4,
h5 {
    font-family: var(--font-heading);
    color: var(--text-midnight);
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    background-color: #ffffff;
    /* Solid background instead of blur */
    box-shadow: 0 2px 10px rgba(133, 107, 150, 0.05);
    position: sticky;
    top: 0;
    z-index: 500;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-img {
    height: 55px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    display: none !important; /* Image logo already contains the text */
}

nav div:last-child {
    display: flex;
    gap: 2.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-midnight);
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: var(--font-body);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-gold);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

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

/* Container */
.container {
    max-width: 1000px;
    /* Slimmer for reading elegance */
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero {
    text-align: center;
    padding: 5rem 0 3rem 0;
    animation: fadeInDown 1s ease-out forwards;
    position: relative;
    overflow: hidden; /* Prevents the 600px background orb from expanding the page width */
}

/* Subtle glow orb behind hero */
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
    z-index: -1;
    pointer-events: none;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-logo-img {
    max-width: 500px;
    height: auto;
    width: 100%;
    object-fit: contain;
    margin-bottom: 2rem;
    /* Removed expensive drop-shadow filter */
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent-gold);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.04em;
    margin-bottom: 2rem;
    text-align: center;
}

/* Shared Section Styling */
.app-flow-wrapper,
.pass-section {
    margin: 2rem auto;
    padding: 3rem;
    text-align: center;
    /* Removed transitions and hover box-shadows here to prevent scroll lag */
}

.hidden {
    display: none !important;
}

/* Text & Typography specific overrides inside cards */
h2 {
    font-size: 2.6rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.pass-section h3 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-midnight);
    text-align: center;
}

p {
    font-size: 1.15rem;
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* Grid Layouts for PASS benefits */
.pass-benefits {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    text-align: left;
    /* Keep left alignment inside cards for readability */
}

.benefit-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(133, 107, 150, 0.05);
    /* Reduced shadow */
    transition: transform 0.2s ease;
}

/* Little golden magical accent inside benefit card */
.benefit-item::before {
    content: '✧';
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--accent-gold);
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.benefit-item:hover {
    transform: translate3d(0, -10px, 0) scale(1.03);
    box-shadow: 0 20px 45px rgba(133, 107, 150, 0.25);
    /* Deeper hover shadow */
    background: #fff;
    border-color: rgba(212, 175, 55, 0.5);
}

.benefit-item:hover::before {
    opacity: 1;
}

.benefit-item strong {
    color: var(--text-midnight);
    display: block;
    margin-bottom: 0.8rem;
    font-size: 1.4rem;
    font-family: var(--font-heading);
}

/* Lists and Steps Styling */
ul li {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.how-it-works-step {
    margin-bottom: 3rem;
    padding-left: 2rem;
    border-left: 2px dashed rgba(212, 175, 55, 0.4);
    position: relative;
    text-align: left;
    /* Left align the step content */
}

.how-it-works-step::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
}

/* Forms */
.form-group {
    margin-bottom: 2rem;
    text-align: left;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

label {
    display: block;
    font-weight: 700;
    color: var(--text-midnight);
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
}

/* Golden text for the main form flows to make them pop */
#preview-flow h2,
#preview-flow p,
#preview-flow label,
#payment-flow h2,
#payment-flow p,
#payment-flow label {
    color: var(--accent-gold);
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select {
    width: 100%;
    padding: 1.2rem;
    border: 2px solid rgba(133, 107, 150, 0.15);
    border-radius: 16px;
    font-family: var(--font-body);
    font-size: 1.05rem;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--text-midnight);
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-plum);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(133, 107, 150, 0.1);
}

.split-input {
    display: flex;
    gap: 0.5rem;
}

.split-input select {
    padding: 1.2rem 0.5rem;
    flex: 1;
    min-width: 0;
}

.error-msg {
    color: var(--error-red);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-align: center;
    font-weight: 600;
}

.cta-button {
    display: inline-block;
    background: var(--text-midnight);
    color: #FFFFFF;
    padding: 1.4rem 4rem;
    border: none;
    border-radius: 50px;
    /* Full pill shape */
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: 0 4px 10px rgba(26, 26, 46, 0.15);
    font-family: var(--font-body);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    width: 100%;
}

.cta-button:hover {
    background: var(--accent-plum);
}

.cta-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #A0A5B1;
    box-shadow: none;
    transform: none;
}

.cta-button:disabled::after {
    display: none;
}

/* Disclaimer Box */
.disclaimer-box {
    background-color: rgba(224, 93, 93, 0.05);
    border: 1px solid rgba(224, 93, 93, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

/* Results & Stats */
.result-box {
    margin-bottom: 2rem;
}

.astro-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2.5rem 0;
}

.stat-box {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.08);
}

.stat-label {
    display: block;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: var(--font-body);
}

.syllable-text {
    font-family: var(--font-heading);
    font-size: 1.6rem !important;
}

.blurred-names-box {
    margin-top: 3rem;
    position: relative;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(133, 107, 150, 0.05) 100%);
    border: 1px dashed var(--accent-gold);
    border-radius: 24px;
    overflow: hidden;
}

.blur-overlay h4 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-midnight);
}

/* Final Names Grid */
.grid-table {
    margin-top: 3rem;
}

.grid-header,
.grid-row {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(133, 107, 150, 0.1);
}

.grid-header {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    background-color: rgba(133, 107, 150, 0.05);
    border-radius: 16px 16px 0 0;
    color: var(--text-midnight);
    border-bottom: 2px solid rgba(133, 107, 150, 0.2);
}

.grid-row {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-midnight);
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Footer */
footer {
    background: transparent;
    padding: 4rem 2rem 2rem 2rem;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

footer::before {
    content: '✧ ✦ ✧';
    display: block;
    text-align: center;
    color: var(--accent-gold);
    margin-bottom: 2rem;
    font-size: 1.2rem;
    letter-spacing: 8px;
    opacity: 0.5;
}

footer a {
    color: var(--accent-plum);
    text-decoration: none;
    margin: 0 1rem;
    font-weight: 700;
    transition: color 0.3s ease;
    cursor: pointer;
}

footer a:hover {
    color: var(--text-midnight);
    text-decoration: underline;
}

.page {
    animation: fadeIn 0.3s ease-out;
    min-height: unset;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* PDF Specific Classes */
.pdf-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
    width: 80%;
    max-width: 600px;
}

.pdf-export-mode {
    background: white !important;
    border: none !important;
    box-shadow: none !important;
    color: #1A1A2E !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        padding: 1rem;
        gap: 0.8rem;
    }

    .logo-container {
        justify-content: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .logo-img {
        height: 60px; /* Slightly larger for emphasis */
        max-width: 100%;
    }

    nav div:last-child {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1.2rem !important;
        width: 100%;
    }

    nav a {
        font-size: 1.15rem;
        padding: 0.4rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .hero-logo-img {
        max-width: 85%;
    }

    .app-flow-wrapper,
    .pass-section {
        padding: 1.2rem;
        margin: 1.2rem 0.2rem;
    }

    h1 {
        font-size: 1.6rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
        text-align: center;
    }

    .pass-section h3, h3 {
        font-size: 1.2rem !important;
        margin-top: 1.2rem;
        text-align: center;
    }

    p {
        font-size: 0.9rem;
        text-align: center;
    }

    .benefit-item, .benefit-item strong, .benefit-item p {
        text-align: center;
    }

    .benefit-item {
        padding: 1.2rem;
    }

    .benefit-item::before {
        display: none; /* Remove golden accents to declutter */
    }

    .how-it-works-step {
        text-align: center;
        padding-left: 0;
        border-left: none;
        margin-bottom: 1.5rem;
    }

    .how-it-works-step::before {
        display: none;
    }

    .form-group label {
        text-align: left; /* Keep form labels left for readability */
        font-size: 0.95rem;
    }

    .form-row,
    .pass-benefits {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .astro-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .cta-button {
        padding: 1.2rem 2rem;
        font-size: 1.1rem;
        width: 100%;
    }

    .how-it-works-step {
        margin-bottom: 2rem;
    }

    /* Results Table to Luxury Cards */
    .grid-header {
        display: none; /* Hide header on mobile */
    }

    .grid-row {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1.2rem;
        margin-bottom: 1.2rem;
        background: white;
        border: 1px solid rgba(133, 107, 150, 0.15);
        border-radius: 16px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
        position: relative;
    }

    .b-name {
        font-family: var(--font-heading);
        font-size: 1.4rem;
        color: var(--accent-plum);
        padding-right: 0;
        text-align: center;
    }

    .b-meaning {
        font-size: 0.9rem;
        line-height: 1.4;
        color: var(--text-dark);
        border-top: 1px solid rgba(133, 107, 150, 0.05);
        padding-top: 0.5rem;
        text-align: center;
    }

    .b-source {
        position: relative;
        background: linear-gradient(135deg, var(--accent-gold), #B8860B);
        color: white;
        width: max-content;
        height: auto;
        padding: 0.2rem 0.8rem;
        display: inline-block;
        border-radius: 20px;
        font-size: 0.8rem;
        font-weight: 700;
        box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
        margin: 0.3rem auto 0 auto;
        align-self: center;
    }

    /* Document/Report Tweaks */
    #pdfContentArea, .user-details-summary {
        padding: 1.5rem 1rem !important;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word; /* Prevents long emails from overflowing Container */
    }

    /* Break the long names or emails specifically if needed */
    #final-location, #final-lastName, #email {
        word-break: break-all;
    }

    .combo-details, .horoscope-details {
        padding: 1rem !important;
        text-align: center;
    }

    /* Force Rashi grids to stack gracefully on small screens without overflowing */
    .rashi-grid {
        grid-template-columns: 1fr !important; /* Stack vertically entirely */
        gap: 1rem !important;
    }

    .rashi-card {
        padding: 1rem !important;
    }
}


/* Custom Autocomplete Dropdown Styling */
.autocomplete-items {
    position: absolute;
    border: 2px solid rgba(133, 107, 150, 0.15);
    border-top: none;
    z-index: 1000;
    top: calc(100% - 10px);
    /* Overlap slightly with input curve */
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background-color: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 10px 25px rgba(133, 107, 150, 0.15);
}

.autocomplete-items div {
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(133, 107, 150, 0.08);
    color: var(--text-midnight);
    font-size: 1.05rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

.autocomplete-items div:last-child {
    border-bottom: none;
    border-radius: 0 0 16px 16px;
}

.autocomplete-items div:hover {
    background-color: rgba(212, 175, 55, 0.08);
    /* Soft gold tint */
    color: var(--accent-plum);
}

/* --- FAQ & Rashi Card Styles --- */
.faq-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(133, 107, 150, 0.1);
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

.rashi-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(133, 107, 150, 0.1);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.rashi-card:hover {
    border-color: var(--primary-mystic);
    box-shadow: 0 8px 25px rgba(133, 107, 150, 0.1);
    transform: scale(1.03);
}

.rashi-card strong {
    color: var(--primary-mystic);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.3rem;
}

.rashi-card small {
    color: var(--text-soft);
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem !important;
    }
    
    .pass-section h2 {
        font-size: 1.8rem !important;
    }
}

/* --- Print Styles (Zero-JS PDF Alternative) --- */
@media print {
    /* Hide everything that isn't the report */
    nav, footer, .cta-button, .disclaimer-box, .app-flow-wrapper:not(#final-results), .pass-section, .hero, #btnDownloadPdf, #btnStartOver {
        display: none !important;
    }

    body {
        background-color: white !important;
        margin: 0;
        padding: 0;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #final-results {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    #pdfContentArea {
        display: block !important;
        margin-top: 0 !important;
        padding: 0.5in !important;
        background: #FBF7F0 !important;
        border: 1px solid rgba(204, 163, 0, 0.25) !important;
        border-radius: 0 !important;
        min-height: 10in;
        box-shadow: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .pdf-watermark {
        display: block !important;
        opacity: 0.05 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .grid-table {
        margin-top: 1rem !important;
    }

    .grid-row {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    h3 {
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    /* Force background colors to print */
    .combo-details, .horoscope-details, .grid-header {
        background-color: #EDE5D8 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* --- MOBILE SPECIFIC FIXES --- */


.global-scroll-cards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.global-scroll-cards > div {
    flex: 1 1 280px; /* Distribute cards horizontally on desktop */
    background: #ffffff;
    padding: 2.5rem 1.5rem;
    border-radius: 24px;
    border: 3px solid var(--accent-gold); /* Distinct gold border matching theme */
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.1);
    text-align: center;
}

.global-scroll-cards > div h3,
.global-scroll-cards > div p {
    text-align: center !important; /* Force center to match image */
}

.global-scroll-cards > div h3 {
    color: var(--accent-gold) !important;
    margin-bottom: 1.5rem !important;
    font-size: 1.6rem !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.15); /* Legibility shadow */
    margin-top: 0 !important;
}

.global-scroll-cards > div p {
    font-size: 1rem;
    color: var(--text-midnight) !important;
    font-weight: 600;
}

@media (max-width: 768px) {
    .global-scroll-cards {
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 2rem;
        gap: 1.5rem;
        -webkit-overflow-scrolling: touch;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        justify-content: flex-start;
    }
    
    .global-scroll-cards > div {
        flex: 0 0 85%; /* Fits gracefully into parent container instead of strictly viewport */
        scroll-snap-align: center;
        margin-bottom: 0 !important;
        flex-shrink: 0;
        box-sizing: border-box;
        max-width: 100%;
    }
    
    .global-scroll-cards::-webkit-scrollbar {
        height: 6px;
    }
    .global-scroll-cards::-webkit-scrollbar-thumb {
        background: var(--accent-gold);
        border-radius: 10px;
    }

    button.long-cta-btn {
        font-size: 0.9rem !important;
        padding: 1rem 1rem !important;
        white-space: normal !important;
        line-height: 1.4 !important;
    }
}
