/* ====================================================
   CopySpring — builder-modern.css
   Warm professional. Squarespace/Webflow feel.
   ==================================================== */

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

:root {
    --ink:          #1a1a18;
    --ink-mid:      #555550;
    --ink-muted:    #8a8a84;
    --rule:         #e8e6e1;
    --rule-light:   #f0ede8;
    --surface:      #f9f7f4;
    --white:        #ffffff;

    --spring:       #c4713a;   /* warm terracotta — the "Spring" accent */
    --spring-hover: #a85e2e;
    --spring-light: #fdf3ec;

    --green:        #2e7d52;
    --green-light:  #eaf4ee;

    --red:          #b91c1c;
    --red-light:    #fef2f2;

    --radius:       10px;
    --radius-sm:    6px;
    --radius-lg:    14px;

    --shadow-sm:    0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

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

/* ====================================================
   NAV
   ==================================================== */
.nav {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--rule);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-copy   { color: var(--ink); }
.logo-spring { color: var(--spring); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-mid);
    text-decoration: none;
    transition: color 0.15s;
}

.nav-links a:hover { color: var(--ink); }

.nav-phone {
    font-weight: 600 !important;
    color: var(--ink) !important;
}

/* ====================================================
   BUILDER SHELL
   ==================================================== */
.builder-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}

.builder-container {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 32px;
    align-items: start;
}

/* ====================================================
   LEFT: FORM
   ==================================================== */
.builder-left {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

/* Form Header / Progress */
.form-header {
    padding: 24px 28px 0;
    border-bottom: 1px solid var(--rule-light);
}

.step-track {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
}

.step-track-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-muted);
    transition: color 0.2s;
}

.step-track-item.active  { color: var(--ink); }
.step-track-item.done    { color: var(--green); }

.track-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rule);
    transition: background 0.2s;
    flex-shrink: 0;
}

.step-track-item.active .track-dot { background: var(--spring); }
.step-track-item.done   .track-dot { background: var(--green); }

.track-line {
    flex: 1;
    height: 1px;
    background: var(--rule);
    margin: 0 10px;
}

.progress-bar-wrap {
    height: 3px;
    background: var(--rule-light);
    border-radius: 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--spring);
    width: 33%;
    transition: width 0.4s ease;
    border-radius: 0 2px 2px 0;
}

/* Step content */
.builder-form { padding: 0; }

.step { display: none; }
.step.active { display: block; }

.step-intro {
    padding: 28px 28px 0;
}

.step-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
    color: var(--spring);
    margin-bottom: 8px;
}

.step-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--ink);
    margin-bottom: 6px;
    line-height: 1.25;
}

.step-desc {
    font-size: 13.5px;
    color: var(--ink-muted);
    line-height: 1.6;
}

.form-fields {
    padding: 24px 28px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── FIELD ── */
.field-group { display: flex; flex-direction: column; }

.field-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 7px;
    letter-spacing: 0.1px;
}

.required { color: var(--spring); margin-left: 1px; }

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    padding: 10px 13px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
    border-color: var(--spring);
    box-shadow: 0 0 0 3px rgba(196,113,58,0.12);
}

.field-group input::placeholder,
.field-group textarea::placeholder {
    color: var(--ink-muted);
    opacity: 0.75;
}

.field-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238a8a84' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
}

.field-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.55;
}

.field-hint {
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 5px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ── CHOICE CARDS (radio + checkbox) ── */
.choice-group {
    display: grid;
    gap: 8px;
}

.choice-group.three-col { grid-template-columns: repeat(3, 1fr); }
.choice-group.two-col   { grid-template-columns: repeat(2, 1fr); }

.choice-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.choice-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.choice-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    background: var(--white);
    gap: 2px;
    min-height: 52px;
}

.choice-card input:checked ~ .choice-inner {
    border-color: var(--spring);
    background: var(--spring-light);
}

.choice-inner:hover {
    border-color: #c8c4bc;
    background: var(--surface);
}

.choice-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.choice-card input:checked ~ .choice-inner .choice-main {
    color: var(--spring);
}

.choice-sub {
    font-size: 11px;
    color: var(--ink-muted);
}

/* ── STYLE GRID ── */
.style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.style-card {
    position: relative;
    cursor: pointer;
    display: block;
}

.style-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.style-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s, background 0.15s;
    background: var(--white);
}

.style-card input:checked ~ .style-inner {
    border-color: var(--spring);
    background: var(--spring-light);
}

.style-swatch {
    display: block;
    height: 5px;
    border-radius: 3px;
    width: 100%;
}

.style-swatch.professional { background: #1e40af; }
.style-swatch.bold         { background: #b91c1c; }
.style-swatch.friendly     { background: #2e7d52; }
.style-swatch.luxury       { background: #6d28d9; }

.style-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
}

.style-card input:checked ~ .style-inner .style-name {
    color: var(--spring);
}

.style-desc {
    font-size: 11px;
    color: var(--ink-muted);
    line-height: 1.4;
}

/* ── COLOR PICKER ── */
.color-picker {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.color-opt {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.color-opt input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
}

.color-opt input:checked ~ .color-dot {
    border-color: var(--ink);
    transform: scale(1.18);
}

.color-dot.blue   { background: #1e40af; }
.color-dot.green  { background: #2e7d52; }
.color-dot.red    { background: #b91c1c; }
.color-dot.orange { background: #c2410c; }
.color-dot.purple { background: #6d28d9; }
.color-dot.dark   { background: #1a1a18; }

.color-name {
    font-size: 11px;
    color: var(--ink-muted);
    font-weight: 500;
}

/* ── FORM ACTIONS ── */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 28px;
    gap: 12px;
}

.form-actions.single {
    justify-content: flex-end;
}

/* ── BUTTONS ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--white);
    background: var(--ink);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}

.btn-primary:hover { background: #2e2e2a; }
.btn-primary:active { transform: scale(0.98); }

.btn-next .btn-arrow { font-size: 15px; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--ink-mid);
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    white-space: nowrap;
}

.btn-secondary:hover {
    border-color: #bbb;
    color: var(--ink);
    background: var(--surface);
}

.btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 14.5px;
    font-weight: 700;
    font-family: inherit;
    color: var(--white);
    background: var(--spring);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.1px;
}

.btn-generate:hover  { background: var(--spring-hover); }
.btn-generate:active { transform: scale(0.98); }

/* ====================================================
   RIGHT: PREVIEW
   ==================================================== */
.builder-right {
    position: sticky;
    top: 80px;
}

.preview-shell {
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

/* Browser chrome bar */
.preview-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
}

.preview-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.preview-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rule);
    display: block;
}

.preview-dots span:first-child  { background: #f97066; }
.preview-dots span:nth-child(2) { background: #f9a825; }
.preview-dots span:nth-child(3) { background: #66bb6a; }

.preview-url-bar {
    flex: 1;
    background: var(--white);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11.5px;
    color: var(--ink-muted);
    font-family: 'Inter', monospace;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-badge {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--spring);
    background: var(--spring-light);
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Preview content area */
.preview-body {
    min-height: 440px;
    position: relative;
    background: var(--surface);
    display: flex;
    align-items: stretch;
}

.preview-placeholder {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    gap: 20px;
}

/* Skeleton illustration */
.placeholder-illustration {
    width: 100%;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0.45;
}

.ph-header {
    height: 32px;
    background: var(--rule);
    border-radius: 4px;
}

.ph-hero {
    height: 100px;
    background: linear-gradient(135deg, #e8e6e1 0%, #d8d4cd 100%);
    border-radius: 6px;
}

.ph-cards {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
}

.ph-card {
    height: 60px;
    background: var(--rule);
    border-radius: 4px;
}

.ph-text-lines {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 4px;
}

.ph-line {
    height: 10px;
    background: var(--rule);
    border-radius: 3px;
}

.ph-line.long   { width: 100%; }
.ph-line.medium { width: 72%; }
.ph-line.short  { width: 48%; }

.placeholder-label {
    font-size: 13px;
    color: var(--ink-muted);
    text-align: center;
    line-height: 1.5;
    max-width: 220px;
}

#previewFrame {
    width: 100%;
    min-height: 440px;
    border: none;
    display: block;
}

/* Preview footer */
.preview-footer {
    border-top: 1px solid var(--rule-light);
    padding: 12px 16px;
    background: var(--white);
}

.human-qc-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.5;
}

.qc-icon {
    color: var(--spring);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ====================================================
   OVERLAYS
   ==================================================== */
.overlay-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(26,26,24,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.overlay-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.overlay-wide {
    max-width: 680px;
}

.overlay-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--ink);
}

.overlay-sub {
    font-size: 14px;
    color: var(--ink-muted);
}

/* Loading ring */
.loading-ring {
    width: 44px;
    height: 44px;
    border: 3px solid var(--rule);
    border-top-color: var(--spring);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 280px;
}

.loading-step {
    font-size: 13px;
    color: var(--ink-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.25s;
    text-align: left;
}

.loading-step.active {
    background: var(--spring-light);
    border-color: rgba(196,113,58,0.2);
    color: var(--spring);
    font-weight: 600;
}

.loading-step.done {
    color: var(--green);
}

/* Success */
.success-check {
    width: 56px;
    height: 56px;
    background: var(--green-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-frame {
    width: 100%;
    height: 320px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.human-review-notice {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 12.5px;
    color: var(--ink-mid);
    line-height: 1.55;
    text-align: left;
    width: 100%;
}

.human-review-notice code {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--ink);
    background: var(--rule-light);
    padding: 6px 10px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

/* Error */
.error-icon-wrap {
    width: 56px;
    height: 56px;
    background: var(--red-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 900px) {
    .builder-container {
        grid-template-columns: 1fr;
    }

    .builder-right {
        position: static;
    }

    .preview-shell {
        display: none; /* hidden on mobile; form takes full width */
    }
}

@media (max-width: 600px) {
    .builder-shell { padding: 20px 16px 60px; }
    .nav-container { padding: 0 16px; }
    .nav-links { gap: 16px; }
    .nav-links a:not(.nav-phone) { display: none; }
    .form-fields { padding: 20px 20px 0; }
    .step-intro { padding: 22px 20px 0; }
    .form-actions { padding: 20px 20px 24px; }
    .field-row { grid-template-columns: 1fr; }
    .overlay-panel { padding: 32px 24px; }
}
