/* ============================================
   WTF BUILDER - CONSOLIDATED STYLESHEET
   ============================================ */

/* === CSS VARIABLES === */
:root {
    --bg-cream: #E8E4D9;
    --white: #FFFFFF;
    --black: #000000;
    --text-dark: #1a1a1a;
    --text-gray: #666666;
    --purple: #9333EA;
    --green: #10B981;
    --border-color: #E5E7EB;
    --yellow-highlight: #FFFCD8;
    --error: #EF4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-cream);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

/* === UTILITY CLASSES === */
.hidden {
    display: none;
}

.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-gray);
}

/* === SHARED BUTTON STYLES === */
.btn {
    font-family: 'Kode Mono', monospace;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--black);
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--purple);
    color: var(--white);
    border: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--bg-cream);
}

/* Dropdown menus (shared) */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 10;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
}

.dropdown-menu button:hover {
    background: #F9FAFB;
}

.dropdown-menu button.danger {
    color: var(--error);
}

/* Google icon (shared) */
.google-icon {
    width: 20px;
    height: 20px;
}

/* ============================================
   LOGIN PAGE (index.html)
   ============================================ */
body.login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-page .logo {
    margin-top: 48px;
    margin-bottom: 80px;
}

.login-page .container {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.login-page h1 {
    font-family: 'Fraunces', serif;
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.login-page p {
    font-size: 18px;
    margin-bottom: 40px;
    color: var(--text-gray);
}

.google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Inter', sans-serif;
    background: var(--white);
    color: var(--text-dark);
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.google-btn:hover {
    border-color: var(--purple);
    background: #FAFAFA;
}

.google-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-gray);
}

.error {
    color: #C33;
}

/* ============================================
   DASHBOARD PAGE (dashboard.html)
   ============================================ */
.dashboard-page .header {
    padding: 24px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-page .logo {
    font-family: 'Kode Mono', monospace;
    font-size: 32px;
    font-weight: 700;
    color: var(--black);
    text-decoration: none;
}

.dashboard-page .container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 24px;
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.user-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 10;
    overflow: hidden;
}

.user-menu.show {
    display: block;
}

.user-menu button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
}

.user-menu button:hover {
    background: #F9FAFB;
}

/* Card */
.card {
    background: var(--white);
    padding: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

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

.card-header h1 {
    font-family: 'Fraunces', serif;
    font-size: 42px;
    font-weight: 800;
    color: var(--text-dark);
}

/* Add form button */
.btn-add {
    font-family: 'Kode Mono', monospace;
    background: var(--purple);
    color: var(--white);
    padding: 12px 24px;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-add:hover {
    opacity: 0.9;
}

/* Forms list */
.forms-list {
    border-top: 1px solid #000;
}

.form-item {
    display: flex;
    align-items: center;
    border: 1px solid #000000;
    border-top: none;
    padding: 0 0 0 20px;
    height: 100px;
    cursor: pointer;
}

.form-info {
    flex: 1;
}

.form-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.form-title {
    font-family: 'Kode Mono', monospace;
    font-size: 24px;
    font-variant: titling-caps;
    font-weight: 600;
    color: var(--text-dark);
}

.form-meta {
    font-size: 13px;
    color: var(--text-gray);
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-draft {
    background: #F3F4F6;
    color: var(--text-gray);
}

.status-published {
    background: var(--green);
    color: var(--white);
}

/* Form stats */
.form-stats {
    display: flex;
    gap: 24px;
    background: var(--yellow-highlight);
    padding: 12px 20px;
    height: 100%;
    align-items: center;
}

.stat {
    text-align: center;
}

.stat-label {
    font-size: 11px;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-family: 'Fraunces', serif;
    font-size: 28px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Form actions */
.form-actions {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: 0;
}

.btn-edit {
    font-family: 'Inter', sans-serif;
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    transition: background 0.2s;
    height: 100%;
    border-left: 1px solid black;
    border-right: 1px solid black;
    width: 100px !important;
}

.btn-edit:hover {
    background: var(--bg-cream);
}

.btn-menu {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
    height: 99px;
    width: 99px;
}

.btn-menu:hover {
    background: var(--bg-cream);
}

/* Empty state */
.empty-state {
    padding: 60px 24px;
    text-align: center;
}

.empty-state h2 {
    font-family: 'Fraunces', serif;
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.empty-state p {
    color: var(--text-gray);
    margin-bottom: 24px;
}

/* ============================================
   EDITOR PAGE (editor.html)
   ============================================ */

/* Editor header */
.editor-header {
    background: var(--bg-cream);
    border-bottom: 1px solid var(--black);
    height: 60px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0;
    box-shadow: none;
    position: fixed;
    width: 100vw;
    top: 0px;
}

.back-link {
    font-family: 'Kode Mono', monospace;
    font-size: 14px;
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-right: 1px solid var(--black);
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
}

.back-link:hover {
    text-decoration: underline;
}

/* Editable form name (right side of the header) */
.form-title-input {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 26vw;
    max-width: 300px;
    font-family: 'Kode Mono', monospace;
    font-size: 14px;
    color: var(--text-dark);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 7px 10px;
    text-align: right;
    transition: border-color 0.15s, background 0.15s, text-align 0s;
}

.form-title-input:hover {
    border-color: var(--black);
}

.form-title-input:focus {
    outline: none;
    border-color: var(--black);
    background: var(--white);
    text-align: left;
}

/* Header tabs */
.header-tabs {
    display: flex;
}

.tab-btn {
    font-family: 'Kode Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    padding: 0 32px;
    background: none;
    border: none;
    border-right: 1px solid var(--black);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    height: 60px;
}

.tab-btn:first-child {
    border-left: 1px solid var(--black);
}

.tab-btn:hover {
    background: var(--bg-cream);
    border-bottom: 1px solid black;
}

.tab-btn.active {
    background: var(--black);
    color: var(--white);
}

/* Save status */
.save-status {
    font-size: 12px;
    color: var(--text-gray);
}

.save-status.saved {
    color: var(--green);
}

/* Tab panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    margin-top: 60px;
}

/* Editor toolbar (secondary bar) */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* View toggle (Preview/Syntax buttons) */
.view-toggle {
    display: flex;
    border: 1px solid var(--black);
    overflow: hidden;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: 'Kode Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    background: var(--white);
    color: var(--text-dark);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.toggle-btn:first-child {
    border-right: 1px solid var(--black);
}

.toggle-btn:hover {
    background: var(--bg-cream);
}

.toggle-btn.active {
    background: #1A5F4A;
    color: var(--white);
}

.toggle-btn svg {
    flex-shrink: 0;
}

/* Toolbar buttons (Share/Save) */
.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: 'Kode Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    border: 1px solid var(--black);
    cursor: pointer;
    transition: all 0.15s;
}

.toolbar-btn:hover {
    background: var(--bg-cream);
}

.toolbar-btn svg {
    flex-shrink: 0;
}

/* Main editor container */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 20px;
    padding: 20px;
    background: var(--bg-cream);
}

.editor-pane,
.preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-pane {
    background: #FBFBFB;
    box-shadow: 0px 4px 54px 5px rgba(0, 0, 0, 0.07);
    border-radius: 10px;
}

textarea {
    flex: 1;
    background: #FBFBFB;
    color: #3A3A3A;
    border: none;
    font-family: 'Koh Santepheap', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 30px;
    font-size: 16px;
    line-height: 1.8;
    resize: none;
    outline: none;
    border-radius: 10px;
}

.preview-pane {
    background: white;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.08);
}

/* Browser chrome mockup */
.preview-pane::before {
    content: '';
    display: block;
    height: 40px;
    background: #F5F5F5;
    border-bottom: 1px solid #E0E0E0;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}

#htmlPreview {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

/* Answers tab */
.answers-container {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.answers-header {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.answers-header h2 {
    font-family: 'Fraunces', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.answers-count {
    font-size: 14px;
    color: var(--text-gray);
}

.no-responses {
    background: var(--white);
    border: 1px solid var(--black);
    padding: 48px;
    text-align: center;
    color: var(--text-gray);
}

.responses-table {
    width: 100%;
    background: var(--white);
    border: 1px solid var(--black);
    border-collapse: collapse;
}

.responses-table th,
.responses-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.responses-table th {
    background: var(--bg-cream);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-gray);
}

.responses-table td {
    font-size: 14px;
    color: var(--text-dark);
}

.responses-table tr:hover td {
    background: #FAFAFA;
}

/* Settings tab */
.settings-container {
    padding: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.settings-section {
    background: var(--white);
    border: 1px solid var(--black);
    padding: 24px;
    margin-bottom: 24px;
}

.settings-section h3 {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.settings-section p {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Transform overlay */
.transform-overlay {
    position: fixed;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 10000;
    min-width: 200px;
    pointer-events: auto;
}

.transform-overlay-title {
    font-size: 12px;
    color: var(--text-gray);
    padding: 4px 8px;
    margin-bottom: 4px;
    font-weight: 500;
}

.transform-option {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.transform-option:hover {
    background: var(--bg-cream);
}

.transform-option-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--purple);
    color: white;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

.transform-option-label {
    color: var(--text-dark);
}

/* Google Sheets integration */
.sheets-panel {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
}

.sheets-panel-content {
    max-width: 1200px;
    margin: 0 auto;
}

.sheets-card {
    background: #FAFAFA;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.sheets-card h3 {
    margin-top: 0;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.sheets-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.btn-sheets-connect {
    background: var(--purple);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
    font-size: 14px;
}

.btn-sheets-connect:hover {
    opacity: 0.9;
}

.info-box {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
}

.info-box p {
    margin: 0;
    color: #1E40AF;
    font-size: 0.875rem;
}

.loading-spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--purple);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-connected {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    border-radius: 6px;
    margin-bottom: 16px;
}

.status-icon {
    width: 24px;
    height: 24px;
    background: var(--green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 14px;
}

.status-content h4 {
    margin: 0 0 4px 0;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
}

.status-content p {
    margin: 0;
    color: #666;
    font-size: 0.875rem;
}

.sheet-info {
    background: white;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.sheet-label {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.sheet-name {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 0.95rem;
}

.sheet-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--purple);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.sheet-link:hover {
    text-decoration: underline;
}

.btn-disconnect {
    background: white;
    color: var(--text-dark);
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.btn-disconnect:hover {
    background: var(--bg-cream);
}

/* ============================================
   PREVIEW PANE STYLES (form rendering)
   ============================================ */
.preview-pane form {
    max-width: 600px;
    margin: 0 auto;
}

.preview-pane h1 {
    font-size: 2.5em;
    margin-bottom: 0.3em;
    border: none;
    padding-bottom: 0;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
}

.preview-pane h2 {
    font-size: 1.3em;
    margin-top: 2em;
    margin-bottom: 1em;
    color: #000;
    font-weight: 600;
}

.preview-pane p {
    margin-bottom: 1.5em;
    line-height: 1.8;
    color: #3A3A3A;
    font-size: 15px;
}

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

.preview-pane label {
    display: block;
    font-weight: 500;
    margin-bottom: 12px;
    color: #000;
    font-size: 15px;
    line-height: 1.6;
}

.helper-text {
    font-size: 0.875rem;
    color: #666;
    margin-top: 4px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.form-link {
    color: var(--purple);
    text-decoration: underline;
    font-weight: 500;
}

.form-link:hover {
    color: #7C3AED;
    text-decoration: none;
}

/* Validation styles */
.req-star {
    color: var(--error);
    margin-left: 2px;
}

.req-legend {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
    background: #fdf2f2;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-block;
}

.preview-pane input[type="text"],
.preview-pane input[type="email"],
.preview-pane input[type="password"],
.preview-pane input[type="date"],
.preview-pane select,
.preview-pane textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
}

.preview-pane input:invalid:not(:placeholder-shown),
.preview-pane select:invalid {
    border-color: var(--error);
    background-color: #fff8f8;
}

.form-btn {
    width: 100%;
    padding: 16px;
    background: #2B2B2B;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 30px;
    transition: background 0.2s;
}

.form-btn:hover {
    background: #1a1a1a;
}

.check-item,
.radio-item {
    height: 26px;
    display: flex;
    align-items: baseline;
}

.check-item input,
.radio-item input {
    margin-right: 10px;
}

.check-item label,
.radio-item label {
    font-weight: normal;
    display: inline;
}

/* ============================================
   DOCUMENTATION / SYNTAX GUIDE PAGE
   ============================================ */
main {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.intro {
    text-align: center;
    margin-bottom: 50px;
}

.intro p {
    font-size: 1.2rem;
    color: #666;
}

section {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

section h2 {
    margin-top: 0;
    color: var(--purple);
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

section h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1rem;
    color: #555;
}

p.dividerline {
    height: 1.4px;
    background: #c5c5c5;
    border-radius: 2em;
}

/* Code blocks */
pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
}

code {
    background: #e4e4e7;
    color: #d63384;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* Syntax grid */
.syntax-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .syntax-grid {
        grid-template-columns: 1fr;
    }
}

.example-box {
    border: 1px solid #eee;
    padding: 15px;
    border-radius: 6px;
}

.example-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 8px;
    display: block;
}

footer {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 0.9rem;
}

/* ============================================
   SCALE / RATING FIELD STYLES
   ============================================ */
.preview-pane .scale-field .scale-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.preview-pane .scale-field .scale-options {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    position: relative;
}

.preview-pane .scale-field .scale-option {
    cursor: pointer;
    flex: 1;
}

.preview-pane .scale-field .scale-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.preview-pane .scale-field .scale-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #000;
    border-radius: 4px;
    background: #fff;
    color: #000;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.preview-pane .scale-field .scale-option:hover .scale-btn {
    background: #f5f5f5;
}

.preview-pane .scale-field .scale-option input:checked + .scale-btn {
    background: #000;
    color: #fff;
}

.preview-pane .scale-field .scale-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
}

.preview-pane .scale-field .scale-label {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
}

.preview-pane .scale-field .scale-label.mid {
    text-align: center;
}

.preview-pane .scale-field .scale-label.end {
    text-align: right;
}

/* ============================================
   MULTI-STEP FORM STYLES
   ============================================ */
.preview-pane .wtf-multistep .wtf-step {
    display: none;
}

.preview-pane .wtf-multistep .wtf-step.active {
    display: block;
}

.preview-pane .wtf-step-title {
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
}

.preview-pane .wtf-step-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.preview-pane .wtf-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

/* Keep the last-step Submit (a type=submit button) from inheriting the
   full-width single-page submit styling and inflating the nav row. */
.preview-pane .wtf-step-nav .wtf-btn,
.preview-pane .wtf-step-nav button[type="submit"] {
    width: auto;
    margin-top: 0;
    padding: 12px 24px;
}

.preview-pane .wtf-prev {
    background: #e0e0e0;
    color: #333;
}

.preview-pane .wtf-prev:hover {
    background: #d0d0d0;
}

.preview-pane .wtf-next,
.preview-pane .wtf-submit {
    background: #000;
    color: #fff;
}

.preview-pane .wtf-next:hover,
.preview-pane .wtf-submit:hover {
    background: #333;
}

.preview-pane .wtf-progress {
    margin-bottom: 20px;
}

.preview-pane .wtf-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.preview-pane .wtf-progress-fill {
    height: 100%;
    background: #000;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================
   OTHER OPTION STYLES
   ============================================ */
.preview-pane .other-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.preview-pane .other-option > input[type="checkbox"],
.preview-pane .other-option > input[type="radio"] {
    flex-shrink: 0;
}

.preview-pane .other-option > label {
    flex-shrink: 0;
}

.preview-pane .other-option .other-input {
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    transition: opacity 0.2s, background 0.2s;
}

.preview-pane .other-option .other-input:disabled {
    opacity: 0.5;
    background: #f5f5f5;
    cursor: not-allowed;
}

.preview-pane .other-option .other-input:not(:disabled) {
    background: #fff;
}

/* ============================================
   VALIDATION ERROR STYLES
   ============================================ */
.preview-pane .wtf-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 4px;
}

.preview-pane .wtf-invalid {
    border-color: var(--error) !important;
}

/* Scale validation: the browser flags every radio in a required group, so an
   identical error gets appended to several .scale-option cells. Stack them all
   at one absolute position below the scale so they overlap into a single message. */
.preview-pane .scale-field {
    position: relative;
    padding-bottom: 1.5rem;
}

.preview-pane .scale-field .scale-option .wtf-error {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 1.5rem;
    white-space: nowrap;
}

/* Live preview <-> editor sync: pulse the element the caret is currently on */
#htmlPreview {
    scroll-behavior: smooth;
}

#htmlPreview .wtf-sync-focus {
    animation: wtfSyncPulse 1.1s ease-out;
    border-radius: 8px;
}

@keyframes wtfSyncPulse {
    0%   { box-shadow: 0 0 0 6px rgba(0, 169, 255, 0.18); background: rgba(0, 169, 255, 0.10); }
    100% { box-shadow: 0 0 0 6px rgba(0, 169, 255, 0);    background: transparent; }
}

/* ============================================================
   Publish / share, branding, and response-delete UI (Settings + Answers)
   ============================================================ */

/* Publish share link row */
.share-link-row {
    display: flex;
    gap: 8px;
    margin: 16px 0;
}

.share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--black);
    border-radius: 6px;
    font-family: 'Kode Mono', monospace;
    font-size: 13px;
    color: var(--text-dark);
    background: var(--bg-cream);
}

/* Branding fields */
.brand-field {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.brand-field label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.brand-field small {
    color: var(--text-gray);
    font-size: 12px;
    margin-top: 4px;
}

.brand-input {
    padding: 10px 12px;
    border: 1px solid var(--black);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.brand-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.brand-color {
    width: 64px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--black);
    border-radius: 6px;
    cursor: pointer;
    background: var(--white);
}

.brand-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Delete-response button in the answers table */
.btn-delete-response {
    background: none;
    border: 1px solid var(--border-color, #E5E7EB);
    color: #EF4444;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.btn-delete-response:hover {
    background: #FEF2F2;
    border-color: #EF4444;
}
