/* CSS VARIABLES - The Tendril Beauty Palette */
:root {
    --sage: #a8b5a0;
    --ivory: #fdf8ef;
    --blush: #f4d2c5;
    --emerald: #064e3b;
    --text-dark: #1a2e25;
    --text-light: #526b5d;
    --white: #ffffff;
    
    --font-heading: 'Bodoni Moda', serif;
    --font-body: 'Inter', sans-serif;
    --font-script: 'Mrs Saint Delano', cursive;
}

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--ivory);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(168, 181, 160, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(244, 210, 197, 0.2) 0%, transparent 40%);
    background-attachment: fixed;
}

/* UTILITY */
.hidden {
    display: none !important;
}

/* LAYOUT */
.page-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    text-align: center;
    padding: 40px 0 20px;
}

.logo {
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 5px;
}

.wordmark {
    font-family: var(--font-script);
    font-size: 3rem;
    color: var(--emerald);
    line-height: 1;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 60px;
}

/* VIEWS */
.view {
    animation: fadeIn 0.5s ease forwards;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* HERO / INTRO */
#view-intro {
    text-align: center;
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(6, 78, 59, 0.05);
    margin-top: 20px;
}

.hero-image-container {
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.intro-content {
    padding: 50px 40px;
}

.eyebrow {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--sage);
    font-weight: 600;
    display: block;
    margin-bottom: 16px;
}

.intro-content h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    line-height: 1.1;
    color: var(--emerald);
    margin-bottom: 12px;
}

.subtitle {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.intro-text {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 500px;
    margin: 0 auto 40px;
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 16px 36px;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--emerald);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(6, 78, 59, 0.2);
}

.btn-primary:hover {
    background-color: #04382a;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 78, 59, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: var(--emerald);
    border: 1px solid var(--emerald);
}

.btn-secondary:hover {
    background-color: rgba(6, 78, 59, 0.05);
}

.btn-full {
    width: 100%;
}

/* QUIZ VIEW */
.quiz-container {
    background: var(--white);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(6, 78, 59, 0.05);
    margin-top: 20px;
}

.progress-container {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(168, 181, 160, 0.3);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--emerald);
    width: 0%;
    transition: width 0.4s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: right;
    font-weight: 500;
}

.question-block h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--emerald);
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.3;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* SWATCH CARDS */
.option-card {
    background: var(--white);
    border: 1px solid rgba(168, 181, 160, 0.4);
    border-radius: 16px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-card:hover {
    border-color: var(--emerald);
    box-shadow: 0 10px 20px rgba(6, 78, 59, 0.08);
    transform: translateY(-3px);
}

.swatch {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

/* Dynamic swatch colors based on position */
.option-card:nth-child(1) .swatch { background: linear-gradient(135deg, #f4d2c5, #e6b8a2); }
.option-card:nth-child(2) .swatch { background: linear-gradient(135deg, #e9e2d5, #d8ccb8); }
.option-card:nth-child(3) .swatch { background: linear-gradient(135deg, #a8b5a0, #8a9a81); }
.option-card:nth-child(4) .swatch { background: linear-gradient(135deg, #064e3b, #04382a); }

.option-text {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* LEAD GATE */
#view-leadgate {
    background: var(--white);
    border-radius: 24px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(6, 78, 59, 0.05);
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.match-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.leadgate-content h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--emerald);
    margin-bottom: 16px;
}

.leadgate-content p {
    color: var(--text-light);
    margin-bottom: 40px;
}

.elegant-form {
    text-align: left;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--emerald);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid rgba(168, 181, 160, 0.6);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--ivory);
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--emerald);
    box-shadow: 0 0 0 3px rgba(6, 78, 59, 0.1);
    background-color: var(--white);
}

/* RESULT VIEW */
#view-result {
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(6, 78, 59, 0.05);
    margin-top: 20px;
}

.result-header {
    text-align: center;
    padding: 60px 40px 40px;
    background: linear-gradient(to bottom, rgba(168, 181, 160, 0.15), var(--white));
}

.archetype-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    color: var(--emerald);
    margin-bottom: 20px;
    line-height: 1.1;
}

.archetype-desc {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.routine-section {
    padding: 0 40px 40px;
}

.routine-section h3 {
    text-align: center;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.8rem;
    color: var(--emerald);
    margin-bottom: 30px;
}

.routine-hero-img {
    width: 100%;
    height: 300px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 40px;
}

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

.routine-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.routine-step {
    background: var(--ivory);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(168, 181, 160, 0.3);
}

.step-num {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sage);
    margin-bottom: 8px;
}

.routine-step h4 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--emerald);
    margin-bottom: 12px;
}

.routine-step p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.coupon-box {
    margin: 0 40px 40px;
    padding: 30px;
    background-color: rgba(244, 210, 197, 0.3);
    border: 1px dashed var(--blush);
    border-radius: 16px;
    text-align: center;
}

.coupon-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.coupon-code {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--emerald);
    letter-spacing: 4px;
    margin-bottom: 12px;
}

.coupon-terms {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 20px;
}

.action-footer {
    padding: 0 40px 60px;
}

/* ALERTS & LOADING */
.alert-message {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

#loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(253, 248, 239, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(6, 78, 59, 0.1);
    border-top-color: var(--emerald);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* POWERED BY SLOT */
#wbx-powered-by-slot {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .intro-content h1 { font-size: 2.2rem; }
    .options-grid { grid-template-columns: 1fr; }
    .routine-grid { grid-template-columns: 1fr; }
    .quiz-container, #view-leadgate, #view-result { padding: 30px 20px; }
    .intro-content { padding: 40px 20px; }
    .hero-image-container { height: 250px; }
    .result-header { padding: 40px 20px 30px; }
    .routine-section, .coupon-box, .action-footer { padding-left: 20px; padding-right: 20px; margin-left: 0; margin-right: 0; }
}
