/* Affirmation Tiles — Quiet, sculptural, emotionally warm */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&family=Quicksand:wght@400;500;600&family=Nunito:wght@400;600&family=Lora:wght@400;600&family=Dancing+Script:wght@400;700&display=swap');

:root {
    /* Neutrals — 70-80% of palette */
    --color-bg: #FAF8F5;
    --color-surface: #FFFFFF;
    --color-surface-warm: #F5F0EB;
    --color-text: #2E2A26;
    --color-text-secondary: #6B6560;
    --color-text-muted: #9B9590;
    --color-border: #E8E3DE;
    --color-border-light: #F0ECE8;

    /* Soft color — 15-20% (lavender, mauve, blush, sage) */
    --color-accent: #B8A9C0;
    --color-accent-warm: #C9AEA0;
    --color-accent-sage: #A8B5A0;

    /* Contrast — 5% */
    --color-contrast: #3D3832;
    --color-contrast-warm: #5C534A;

    /* Functional */
    --color-primary: #3D3832;
    --color-primary-hover: #2E2A26;
    --color-primary-light: #F0ECE8;
    --color-success: #A8B5A0;
    --color-error: #C08080;

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Spacing — generous for breathing room */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    --space-3xl: 96px;
    --space-4xl: 128px;

    /* Radii — soft geometry */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* Shadows — subtle, warm */
    --shadow-sm: 0 1px 3px rgba(46, 42, 38, 0.04);
    --shadow-md: 0 4px 16px rgba(46, 42, 38, 0.06);
    --shadow-lg: 0 8px 32px rgba(46, 42, 38, 0.08);
    --shadow-soft: 0 2px 24px rgba(46, 42, 38, 0.04);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: 0.01em;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

p {
    max-width: 38em;
}

/* === Layout === */

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* === Hero === */

.hero {
    text-align: center;
    padding: var(--space-4xl) 0 var(--space-3xl);
    max-width: 640px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: var(--space-lg);
    line-height: 1.15;
}

.hero h1 em {
    font-style: italic;
    font-weight: 400;
}

.hero p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin: 0 auto;
    line-height: 1.8;
}

/* === Configurator === */

.configurator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    margin-bottom: var(--space-3xl);
    align-items: start;
}

@media (max-width: 768px) {
    .configurator {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

.config-panel {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border-light);
}

.config-panel h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-xl);
    color: var(--color-text);
}

.preview-panel {
    position: sticky;
    top: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl) var(--space-xl);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--color-border-light);
    min-height: 440px;
}

.preview-panel h2 {
    font-size: 0.75rem;
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
    align-self: flex-start;
}

#tile-preview {
    border-radius: var(--radius-md);
    max-width: 100%;
}

.preview-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: var(--space-lg);
    text-align: center;
}

/* === Form elements === */

.field {
    margin-bottom: var(--space-xl);
}

.field:last-of-type {
    margin-bottom: var(--space-lg);
}

.field label {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: var(--space-sm);
    color: var(--color-text-secondary);
}

.field textarea,
.field input[type="text"],
.field select {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    color: var(--color-text);
    background: var(--color-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.6;
}

.field textarea {
    resize: vertical;
    min-height: 88px;
}

.field textarea:focus,
.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(184, 169, 192, 0.15);
}

.field textarea::placeholder {
    color: var(--color-text-muted);
    font-style: italic;
}

.char-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: right;
    margin-top: var(--space-xs);
}

.char-count.over {
    color: var(--color-error);
    font-weight: 500;
}

/* === Option selectors === */

.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
}

.option-btn {
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    cursor: pointer;
    text-align: center;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.option-btn:hover {
    border-color: var(--color-accent);
    background: var(--color-surface);
}

.option-btn.selected {
    border-color: var(--color-contrast);
    background: var(--color-surface);
    color: var(--color-text);
    font-weight: 500;
}

.option-btn .price {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-weight: 300;
}

/* === Color swatches === */

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.08);
}

.color-swatch.selected {
    border-color: var(--color-contrast);
    box-shadow: 0 0 0 3px var(--color-surface), 0 0 0 5px var(--color-contrast);
}

.color-swatch .color-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    white-space: nowrap;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

/* === Font preview === */

.font-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.font-btn {
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    color: var(--color-text-secondary);
    transition: all 0.2s;
}

.font-btn:hover {
    border-color: var(--color-accent);
    background: var(--color-surface);
}

.font-btn.selected {
    border-color: var(--color-contrast);
    background: var(--color-surface);
    color: var(--color-text);
}

/* === Pricing === */

.price-display {
    text-align: center;
    padding: var(--space-lg) var(--space-xl);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.price-display .total {
    font-size: 2.2rem;
    font-weight: 400;
    font-family: var(--font-heading);
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.price-display .breakdown {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: var(--space-xs);
    letter-spacing: 0.02em;
}

/* === CTA === */

.btn-primary {
    display: block;
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background: var(--color-contrast);
    color: var(--color-surface-warm);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-primary:disabled {
    background: var(--color-border);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* === Divider === */

.section-divider {
    width: 48px;
    height: 1px;
    background: var(--color-border);
    margin: 0 auto;
}

/* === Info sections === */

.info-section {
    text-align: center;
    padding: var(--space-3xl) 0;
}

.info-section + .info-section {
    padding-top: 0;
}

.info-section h2 {
    font-size: 1.8rem;
    margin-bottom: var(--space-sm);
}

.info-section > p {
    color: var(--color-text-muted);
    margin: 0 auto var(--space-2xl);
    font-size: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2xl);
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 640px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

.info-item {
    padding: var(--space-lg);
}

.info-item h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--color-text);
}

.info-item p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin: 0 auto;
    line-height: 1.8;
}

.info-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

/* === Footer === */

footer {
    text-align: center;
    padding: var(--space-2xl) 0;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    border-top: 1px solid var(--color-border-light);
    margin-top: var(--space-2xl);
}

/* === Success page === */

.success-page {
    text-align: center;
    padding: var(--space-4xl) 0 var(--space-3xl);
    max-width: 480px;
    margin: 0 auto;
}

.success-page .checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-accent-sage);
    color: white;
    font-size: 1.8rem;
    margin-bottom: var(--space-xl);
}

.success-page h1 {
    font-size: 2rem;
    margin-bottom: var(--space-md);
}

.success-page p {
    color: var(--color-text-secondary);
    margin: 0 auto var(--space-md);
    line-height: 1.8;
}

.success-next {
    margin-top: var(--space-2xl);
    padding: var(--space-xl);
    background: var(--color-surface-warm);
    border-radius: var(--radius-lg);
    text-align: left;
}

.success-next strong {
    display: block;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: var(--space-sm);
}

.success-next p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin: 0;
}

/* === Shipping zone toggle === */

.shipping-toggle {
    display: flex;
    gap: var(--space-sm);
}

.shipping-toggle .option-btn {
    flex: 1;
}

/* === Responsive === */

@media (max-width: 768px) {
    .hero {
        padding: var(--space-3xl) 0 var(--space-2xl);
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .configurator {
        gap: var(--space-lg);
    }

    .preview-panel {
        position: static;
    }

    .info-section {
        padding: var(--space-2xl) 0;
    }

    .info-section h2 {
        font-size: 1.4rem;
    }
}
