/* ============================================
   SHUTTER QUOTE WIZARD - MAIN STYLES
   ============================================ */

:root {
    /* Brand Colours - EDIT THESE to white-label */
    --brand-primary: #2c3e50;
    --brand-accent: #c9a96e;
    --brand-accent-hover: #b8944f;
    --brand-dark: #1a252f;
    --brand-light: #f8f6f3;

    /* Neutrals */
    --text: #2d2d2d;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --bg: #fdfcfa;
    --bg-card: #ffffff;
    --border: #e5e2dc;
    --border-hover: #c9a96e;
    --shadow: rgba(44, 62, 80, 0.08);
    --shadow-lg: rgba(44, 62, 80, 0.12);

    /* Spacing */
    --header-height: 64px;
    --max-width: 960px;
    --radius: 12px;
    --radius-sm: 8px;
}

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

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

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============ HEADER ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--brand-dark);
    color: #fff;
    height: var(--header-height);
    border-bottom: 3px solid var(--brand-accent);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.logo-icon {
    font-size: 1.6rem;
    color: var(--brand-accent);
}

.header-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: var(--brand-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.2s;
}

.header-call-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ============ PROGRESS BAR ============ */
.progress-wrapper {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 12px;
    position: sticky;
    top: var(--header-height);
    z-index: 99;
}

.progress-bar {
    max-width: var(--max-width);
    margin: 0 auto 12px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--brand-accent);
    border-radius: 2px;
    width: 16.66%;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-steps {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
}

.progress-step {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.progress-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s;
}

.progress-step.active {
    color: var(--brand-primary);
}

.progress-step.active span {
    background: var(--brand-accent);
    color: #fff;
}

.progress-step.completed span {
    background: var(--brand-primary);
    color: #fff;
}

/* ============ WIZARD CONTAINER ============ */
.wizard-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 24px 80px;
    flex: 1;
}

.wizard-step {
    display: none;
    animation: fadeSlideIn 0.4s ease-out;
}

.wizard-step.active {
    display: block;
}

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

/* ============ STEP HEADERS ============ */
.step-header {
    text-align: center;
    margin-bottom: 36px;
}

.step-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.step-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ============ OPTION CARDS (Style & Material) ============ */
.card-grid {
    display: grid;
    gap: 20px;
}

.style-grid {
    grid-template-columns: repeat(3, 1fr);
}

.material-grid {
    grid-template-columns: repeat(2, 1fr);
}

.option-card {
    position: relative;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 20px 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.option-card:hover {
    border-color: var(--brand-accent);
    box-shadow: 0 4px 20px var(--shadow);
    transform: translateY(-2px);
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-card input[type="radio"]:checked ~ .card-check {
    opacity: 1;
    transform: scale(1);
}

.option-card:has(input:checked) {
    border-color: var(--brand-accent);
    background: linear-gradient(135deg, #fdf9f3, #fff);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.15), 0 4px 20px var(--shadow);
}

.card-visual {
    width: 100%;
    max-width: 140px;
    margin-bottom: 16px;
}

.shutter-svg {
    width: 100%;
    height: auto;
    color: var(--brand-primary);
    transition: color 0.3s;
}

.option-card:hover .shutter-svg,
.option-card:has(input:checked) .shutter-svg {
    color: var(--brand-accent);
}

.card-label strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.card-label span {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.card-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: var(--brand-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--brand-primary);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-badge.popular {
    background: var(--brand-accent);
}

/* Material swatches */
.material-visual {
    max-width: 200px;
}

.material-swatch {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0,0,0,0.06);
}

/* ============ COLOUR GRID ============ */
.colour-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.colour-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.colour-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.colour-swatch {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.colour-option:hover .colour-swatch {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.colour-option input:checked ~ .colour-swatch {
    outline: 3px solid var(--brand-accent);
    outline-offset: 3px;
    transform: scale(1.1);
}

.colour-option span {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

.colour-custom {
    background: conic-gradient(
        #ff6b6b, #feca57, #48dbfb, #ff9ff3, #54a0ff, #ff6b6b
    ) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
}

.colour-custom span {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.custom-colour-input {
    max-width: 400px;
    margin: 0 auto 20px;
    animation: fadeSlideIn 0.3s ease;
}

.custom-colour-input label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.custom-colour-input input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.custom-colour-input input:focus {
    outline: none;
    border-color: var(--brand-accent);
}

/* ============ PHOTO UPLOAD ============ */
.photo-upload-area {
    max-width: 600px;
    margin: 0 auto;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    background: rgba(255,255,255,0.6);
    transition: all 0.3s;
    cursor: pointer;
    display: block;
}

.upload-zone:hover {
    border-color: var(--brand-accent);
    background: rgba(201, 169, 110, 0.03);
}

.upload-zone.drag-over {
    border-color: var(--brand-accent);
    background: rgba(201, 169, 110, 0.05);
}

.upload-icon {
    color: var(--brand-accent);
    margin-bottom: 16px;
}

.upload-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.upload-zone > p {
    color: var(--text-muted);
    margin: 8px 0;
    font-size: 0.9rem;
}

.upload-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 16px 0;
}

.btn-upload, .btn-camera {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--border);
    background: #fff;
    color: var(--text);
}

.btn-upload:hover, .btn-camera:hover {
    border-color: var(--brand-accent);
    color: var(--brand-accent);
}

.upload-hint {
    font-size: 0.78rem;
    color: var(--text-light);
}

.upload-preview {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--brand-accent);
}

.upload-preview img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: contain;
    background: #f5f5f5;
}

.btn-remove-photo {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-remove-photo:hover {
    background: rgba(200,50,50,0.9);
}

/* ============ PREVIEW ============ */
.preview-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

.preview-canvas {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f0ede8;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-controls {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
}

.preview-controls label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
}

.preview-controls input[type="range"] {
    width: 100%;
    accent-color: var(--brand-accent);
}

.preview-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.preview-summary h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--brand-primary);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item span {
    color: var(--text-muted);
}

/* Before/After AI Preview */
.before-after-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.ba-panel {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #f0ede8;
    box-shadow: 0 2px 12px var(--shadow);
}

.ba-panel img {
    width: 100%;
    height: auto;
    display: block;
}

.ba-label {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.9);
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    padding: 4px 16px;
    border-radius: 20px;
    z-index: 2;
}

.ba-ai-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 2;
}

.ai-preview-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ai-summary-bar {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 16px 24px;
    margin: 16px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.ai-summary-bar .summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    border: none;
    padding: 0;
}

.ai-summary-bar .summary-item span {
    color: var(--text-muted);
}

/* AI Badge */
.ai-badge {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 1px solid #c8e6c9;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #2e7d32;
    text-align: center;
}

/* AI Loader */
.ai-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f3e8ff, #e8f0ff);
    border: 1px solid #d1c4e9;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: #5e35b1;
}

.ai-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(94, 53, 177, 0.2);
    border-top-color: #5e35b1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Interactive Preview */
.interactive-preview {
    position: relative;
    display: inline-block;
    width: 100%;
    user-select: none;
    -webkit-user-select: none;
}

.interactive-preview img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
    pointer-events: none;
}

.shutter-overlay-interactive {
    position: absolute;
    cursor: grab;
    border: 2px dashed rgba(201, 169, 110, 0.6);
    border-radius: 4px;
    transition: border-color 0.2s;
    overflow: hidden;
    touch-action: none;
}

.shutter-overlay-interactive:hover {
    border-color: var(--brand-accent);
}

.shutter-overlay-interactive:active {
    cursor: grabbing;
    border-color: var(--brand-accent);
    border-style: solid;
}

/* Toggle button */
.btn-toggle {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    color: var(--text);
}

.btn-toggle:hover {
    border-color: var(--brand-accent);
    color: var(--brand-accent);
}

.preview-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 8px;
    line-height: 1.4;
}

/* ============ CONTACT FORM ============ */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

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

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-accent);
}

.form-group input.error,
.form-group textarea.error {
    border-color: #e74c3c;
}

.consent-group {
    margin-top: 8px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    accent-color: var(--brand-accent);
}

.checkbox-label a {
    color: var(--brand-accent);
}

/* ============ BUTTONS ============ */
.step-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
}

.btn-next, .btn-submit {
    background: var(--brand-accent);
    color: #fff;
    min-width: 180px;
}

.btn-next:hover, .btn-submit:hover {
    background: var(--brand-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(201, 169, 110, 0.3);
}

.btn-back {
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.btn-back:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-skip {
    background: transparent;
    color: var(--brand-accent);
    border: 2px solid var(--brand-accent);
}

.btn-skip:hover {
    background: var(--brand-accent);
    color: #fff;
}

.btn-submit {
    min-width: 220px;
    font-size: 1.1rem;
    padding: 16px 40px;
    background: var(--brand-primary);
}

.btn-submit:hover {
    background: var(--brand-dark);
    box-shadow: 0 4px 20px rgba(44, 62, 80, 0.3);
}

/* ============ SUCCESS ============ */
.success-message {
    text-align: center;
    padding: 60px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #27ae60;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 24px;
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-message h1 {
    font-family: 'Playfair Display', serif;
    color: var(--brand-primary);
    margin-bottom: 12px;
}

.success-message p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 24px;
}

.success-ref {
    background: var(--brand-light);
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

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

.btn-success-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    background: var(--brand-accent);
    color: #fff;
}

.btn-success-action:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.btn-whatsapp {
    background: #25D366;
    display: inline-flex;
    align-items: center;
}

.btn-whatsapp:hover {
    background: #1da851;
}

.btn-appointment {
    background: var(--brand-primary, #2c3e50);
}

.btn-appointment:hover {
    background: var(--brand-dark, #1a252f);
}

/* ============ FOOTER ============ */
.site-footer {
    background: var(--brand-dark);
    color: rgba(255,255,255,0.6);
    padding: 24px;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--brand-accent);
}

/* ============ WINDOW MEASUREMENTS ============ */
.windows-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid var(--border);
}

.windows-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.windows-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--brand-primary);
}

.unit-toggle {
    display: flex;
    background: var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.unit-btn {
    padding: 5px 14px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.unit-btn.active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.windows-info {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #92400e;
    margin-bottom: 16px;
}

.windows-info p { margin: 0; }

.window-entry {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    position: relative;
    animation: fadeSlideIn 0.3s ease;
}

.window-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.window-name-input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    padding: 0;
    width: 160px;
}

.window-name-input:focus {
    outline: none;
    border-bottom: 2px solid var(--brand-accent);
}

.window-measurements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.measurement-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.measurement-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.measurement-field input:focus {
    outline: none;
    border-color: var(--brand-accent);
}

.btn-remove-window {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #999;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove-window:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.btn-add-window {
    width: 100%;
    padding: 14px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-window:hover {
    border-color: var(--brand-accent);
    color: var(--brand-accent);
    background: rgba(201, 169, 110, 0.03);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .style-grid { grid-template-columns: repeat(2, 1fr); }
    .material-grid { grid-template-columns: 1fr; }
    .colour-grid { grid-template-columns: repeat(4, 1fr); }
    .form-row { grid-template-columns: 1fr; margin-bottom: 0; gap: 0; }
    .form-group { margin-bottom: 16px; }
    .preview-container { grid-template-columns: 1fr; }
    .before-after-container { grid-template-columns: 1fr; }
    .ai-summary-bar { flex-direction: column; gap: 8px; align-items: flex-start; }
    .step-header h1 { font-size: 1.5rem; }
    
    /* Progress steps: number on top, text below, centered */
    .progress-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2px;
        font-size: 0.6rem;
    }
}

@media (max-width: 480px) {
    .style-grid { grid-template-columns: 1fr 1fr; }
    .colour-grid { grid-template-columns: repeat(3, 1fr); }
    .upload-buttons { flex-direction: column; align-items: center; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
}

/* ============================================================
   ACCOUNTS, HISTORY & TAGS (aiform2)
   ============================================================ */

/* ---- Header navigation ---- */
.user-nav { display: flex; align-items: center; gap: 4px; }
.user-nav a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}
.user-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.user-nav a.active { color: #fff; background: rgba(255,255,255,0.12); }
.user-nav a.nav-admin { color: var(--brand-accent); }
.user-nav a.nav-logout { margin-left: 6px; border: 1px solid rgba(255,255,255,0.2); }
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 1.2rem;
    border-radius: 6px;
    width: 40px;
    height: 36px;
    cursor: pointer;
}

/* ---- Notices ---- */
.notice { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; line-height: 1.5; }
.notice-success { background: #e8f5e9; color: #2e7d32; }
.notice-error   { background: #fdecea; color: #b42318; }
.notice-warning { background: #fff7e6; color: #92400e; border: 1px solid #fde68a; }

/* ---- Auth pages ---- */
.auth-wrap { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px 80px; }
.auth-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 560px;
    border-radius: var(--radius);
    padding: 36px 36px 28px;
    box-shadow: 0 4px 24px var(--shadow);
    border: 1px solid var(--border);
}
.auth-card h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.7rem; color: var(--brand-dark); margin-bottom: 6px; }
.auth-sub { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 22px; }
.auth-form .form-row { margin-bottom: 0; }
.auth-form .form-group { margin-bottom: 16px; }
.btn-block { width: 100%; margin-top: 6px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; font-size: 0.86rem; color: var(--text-muted); }
.auth-links a { color: var(--brand-accent); font-weight: 600; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-done { text-align: center; }
.auth-done .success-icon { margin: 0 auto 16px; }
.field-error { display: block; color: #b42318; font-size: 0.8rem; margin-top: 5px; }
.field-hint { display: block; color: var(--text-light); font-size: 0.78rem; margin-top: 5px; }
.field-hint-inline { color: var(--text-light); font-weight: 400; font-size: 0.8rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Content pages ---- */
.page-container { max-width: 1100px; width: 100%; margin: 0 auto; padding: 36px 24px 80px; flex: 1; }
.page-container.narrow { max-width: 720px; }
.page-title { margin-bottom: 24px; }
.page-title h1 { font-family: 'Playfair Display', Georgia, serif; font-size: 2rem; color: var(--brand-dark); line-height: 1.2; }
.page-title p { color: var(--text-muted); margin-top: 6px; }
.page-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-title-row .btn { padding: 12px 24px; min-width: 0; }
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}
.panel h2 { font-size: 1.15rem; color: var(--brand-dark); margin-bottom: 18px; }
.panel .btn { padding: 12px 28px; }
.panel-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; padding: 20px 28px; }
.panel-meta span { display: block; font-size: 0.78rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; }
.panel-meta strong { font-size: 0.98rem; color: var(--brand-dark); }
.panel-meta a { color: var(--brand-accent); }
.empty-panel { text-align: center; padding: 60px 24px; background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); }
.empty-panel .btn { margin-top: 16px; }
.empty-panel a:not(.btn) { color: var(--brand-accent); }
.success-history { margin-top: 14px; font-size: 0.9rem; color: var(--text-muted); }
.success-history a { color: var(--brand-accent); font-weight: 600; }

/* ---- Tag input (chips) ---- */
.tags-section { margin-top: 32px; padding-top: 32px; border-top: 2px solid var(--border); }
.tags-help { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 12px; }
.tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 50px;
    padding: 8px 10px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: text;
    transition: border-color 0.2s;
}
.tag-input:focus-within { border-color: var(--brand-accent); }
.tag-input-field { flex: 1; min-width: 140px; border: none; outline: none; font: inherit; font-size: 0.95rem; padding: 4px; background: transparent; }
.tag-input-sm { min-height: 38px; padding: 4px 6px; border-width: 1px; }
.tag-input-sm .tag-input-field { font-size: 0.84rem; min-width: 90px; }
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 4px 4px 11px;
    background: #f3ede2;
    color: #6f5323;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}
.tag-chip-remove {
    border: none;
    background: rgba(0,0,0,0.08);
    color: inherit;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
}
.tag-chip-remove:hover { background: #e74c3c; color: #fff; }
.tag-suggestions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 0.82rem; color: var(--text-light); }
.tag-suggestion {
    border: 1px dashed var(--border-hover);
    background: transparent;
    color: var(--text-muted);
    border-radius: 14px;
    padding: 3px 10px;
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}
.tag-suggestion:hover { background: #f3ede2; color: #6f5323; border-style: solid; }
.tag-save-status { font-size: 0.75rem; font-weight: 500; color: var(--text-light); }
.tag-save-status.ok { color: #2e7d32; }
.tag-save-status.err { color: #b42318; }

/* ---- History ---- */
.history-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.history-toolbar input[type="search"] {
    flex: 1;
    min-width: 220px;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.92rem;
    background: #fff;
}
.history-toolbar input[type="search"]:focus { outline: none; border-color: var(--brand-accent); }
.history-toolbar .btn { padding: 10px 20px; font-size: 0.9rem; }
.view-toggle { display: inline-flex; border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle a { padding: 9px 14px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-decoration: none; background: #fff; }
.view-toggle a + a { border-left: 2px solid var(--border); }
.view-toggle a.active { background: var(--brand-dark); color: #fff; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}
.tag-pill span { background: rgba(0,0,0,0.07); border-radius: 10px; padding: 0 7px; font-size: 0.74rem; }
.tag-pill:hover { border-color: var(--brand-accent); }
.tag-pill.active { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.tag-pill.active span { background: rgba(255,255,255,0.25); }
.result-count { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 14px; }
.tag-group { margin-bottom: 36px; }
.tag-group-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 1.2rem; color: var(--brand-dark); padding-bottom: 10px; margin-bottom: 16px; border-bottom: 2px solid var(--border); }
.tag-group-head small { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.sub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.sub-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px var(--shadow);
}
.sub-card.is-incomplete { border-top: 3px solid #f59e0b; }
.sub-images { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 2px; background: var(--border); }
.sub-images-empty { display: flex; align-items: center; justify-content: center; height: 70px; background: var(--brand-light); color: var(--text-light); font-size: 0.85rem; }
.sub-img { position: relative; border: none; padding: 0; background: #eee; cursor: zoom-in; display: block; }
.sub-img img { display: block; width: 100%; height: 170px; object-fit: cover; }
.sub-img span { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,0.6); color: #fff; font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.sub-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.sub-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sub-head strong { font-size: 0.98rem; color: var(--brand-dark); }
.sub-status { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 10px; }
.sub-status.ok { background: #e8f5e9; color: #2e7d32; }
.sub-status.warn { background: #fff3e0; color: #b45309; }
.sub-date { font-size: 0.8rem; color: var(--text-light); margin-top: -6px; }
.sub-specs { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.85rem; }
.sub-specs div { display: flex; gap: 5px; }
.sub-specs dt { color: var(--text-light); }
.sub-specs dd { font-weight: 600; }
.sub-windows summary { cursor: pointer; font-size: 0.85rem; color: var(--brand-accent); font-weight: 600; }
.sub-windows ul { list-style: none; margin-top: 6px; font-size: 0.82rem; }
.sub-windows li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--brand-light); }
.sub-tags { margin-top: auto; }
.sub-tags-label { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 5px; }

/* ---- Lightbox ---- */
.lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; align-items: center; justify-content: center; cursor: zoom-out; padding: 16px; }
.lightbox.active { display: flex; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.lightbox-close { position: absolute; top: 16px; right: 22px; color: #fff; font-size: 2rem; opacity: 0.8; }

@media (max-width: 820px) {
    .nav-toggle { display: block; }
    .user-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--brand-dark);
        padding: 8px 16px 16px;
        border-bottom: 3px solid var(--brand-accent);
        box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    }
    .user-nav.open { display: flex; }
    .user-nav a { padding: 12px; }
    .user-nav a.nav-logout { margin: 6px 0 0; text-align: center; }
    .site-header { position: sticky; }
    .header-inner { position: relative; padding: 0 16px; }
}
@media (max-width: 600px) {
    .auth-card { padding: 26px 20px 22px; }
    .auth-form .form-row { grid-template-columns: 1fr; gap: 0; }
    .page-container { padding: 24px 16px 60px; }
    .page-title h1 { font-size: 1.6rem; }
    .panel { padding: 20px 16px; }
    .page-title-row .btn { width: 100%; }
    .view-toggle { width: 100%; }
    .view-toggle a { flex: 1; text-align: center; }
    .sub-grid { grid-template-columns: 1fr; }
}
.sub-img-missing { display: flex; align-items: center; justify-content: center; height: 170px; background: var(--brand-light); color: var(--text-light); font-size: 0.8rem; text-align: center; padding: 12px; cursor: default; }
