/* SureWire - AI Agent Validation Platform Styles */

:root {
    /* SureWire Brand Colors - Light Mode */
    --primary-color: #d33c65;
    --primary-hover: #b8335a;
    --primary-light: #e05577;
    --secondary-color: #a82d4f;
    --secondary-hover: #8f2643;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --success-light: #34d399;
    --error-color: #ef4444;
    --error-light: #f87171;
    --warning-color: #f59e0b;
    --warning-light: #fbbf24;
    
    /* Light Mode Colors */
    --bg-color: #f8fafc;
    --bg-secondary: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Transitions */
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

/* Dark Mode - Automatic based on system preference */
@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Mode Colors */
        --bg-color: #0f172a;
        --bg-secondary: #1e293b;
        --card-bg: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #64748b;
        --border-color: #334155;
        --border-light: #1e293b;
        
        /* Adjusted shadows for dark mode */
        --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.5s ease;
}

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

/* ============================================
   HEADER STYLES
   ============================================ */

.main-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-lg);
    color: white;
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
    pointer-events: none;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.logo-section h1 {
    font-size: 3rem;
    margin-bottom: 8px;
    color: white;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-section h1 sup {
    font-size: 1.5rem;
    vertical-align: super;
    margin-left: 2px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    margin: 0;
}

.user-info-display {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 18px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.user-name-display {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-email-display {
    font-size: 0.9rem;
    opacity: 0.9;
}

.usage-display {
    display: flex;
    gap: 8px;
    font-size: 0.95rem;
}

.usage-label {
    opacity: 0.8;
}

.usage-value {
    font-weight: 600;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-logout:active {
    transform: translateY(0);
}

/* ============================================
   CARD STYLES
   ============================================ */

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    animation: slideIn 0.4s ease;
}

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

.card:hover {
    box-shadow: var(--shadow-md);
}

.card h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 {
    font-size: 1.35rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 1rem;
    line-height: 1.5;
}

/* ============================================
   FORM STYLES
   ============================================ */

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    border-color: var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.form-example {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-family: 'Courier New', monospace;
}

/* Form Validation Styles */
.input-error {
    border-color: var(--error-color) !important;
    background-color: rgba(239, 68, 68, 0.05);
}

.input-error:focus {
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-error-message {
    display: block;
    margin-top: 6px;
    padding: 8px 12px;
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--error-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--error-color);
    font-weight: 500;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dark mode adjustments for validation */
@media (prefers-color-scheme: dark) {
    .input-error {
        background-color: rgba(239, 68, 68, 0.1);
    }
    
    .field-error-message {
        background-color: rgba(239, 68, 68, 0.15);
    }
}

/* Chatbot Selector Styles — removed (replaced by three-tab mode selector) */

.chatbot-config-section {
    margin-top: 16px;
    padding: 20px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 2px solid var(--border-light);
    animation: slideIn 0.3s ease;
}

.char-counter {
    display: block;
    text-align: right;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Input with toggle button (for password visibility) */
.input-with-toggle {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-toggle input {
    padding-right: 50px;
}

.toggle-visibility {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 1.2rem;
    line-height: 1;
    transition: var(--transition);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-visibility:hover {
    background-color: var(--bg-secondary);
}

.toggle-visibility:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.btn-primary,
.btn-secondary {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow);
    flex: 1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary-hover));
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
    border-color: var(--text-secondary);
}

/* ============================================
   USER INFO CARD
   ============================================ */

#user-info {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

#user-info h3 {
    color: white;
    font-size: 1.5rem;
}

#user-info p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

#user-info span {
    font-weight: 600;
}

/* ============================================
   PROGRESS STYLES
   ============================================ */

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
    flex-wrap: wrap;
    gap: 16px;
}

.job-id-display {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    padding: 8px 14px;
    border-radius: 8px;
}

.progress-status {
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.progress-status.running {
    background-color: rgba(79, 70, 229, 0.15);
    color: var(--primary-color);
}

.progress-status.completed {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
    animation: none;
}

.progress-status.failed {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
    animation: none;
}

.progress-stages-container {
    margin-bottom: 24px;
}




/* Step Counter */
.overall-step-counter {
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

#overall-step-text,
#step-counter {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.5s ease;
    min-width: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ============================================
   TWO-LINE PROGRESS DISPLAY (Option D)
   ============================================ */

/* Completed stages stack */
.completed-stages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.completed-stage-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    animation: slideIn 0.3s ease;
}

.completed-stage-check {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.completed-stage-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--success-color);
    flex: 1;
}

.completed-stage-duration {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Active stage two-line display */
.active-stage-display {
    padding: 16px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
}

.active-stage-label {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* CSS-only activity bar spinner — replaces braille character */
.stage-spinner {
    display: block;
    width: 100%;
    height: 3px;
    margin-top: 10px;
    border-radius: 2px;
    background: var(--bg-secondary);
    overflow: hidden;
    flex-shrink: 0;
}

.stage-spinner::after {
    content: '';
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    animation: stage-activity 1.4s ease-in-out infinite;
}

@keyframes stage-activity {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .active-stage-display {
        border-color: var(--border-color);
    }

    .completed-stage-row {
        border-color: var(--border-color);
    }
}

/* ============================================
   STAGE CARD (single in-progress stage display) — LEGACY, kept for compat
   ============================================ */

.stage-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}

.stage-card .stage-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.stage-card .stage-progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stage-card .stage-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.stage-card .stage-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Dark mode adjustments for stage card */
@media (prefers-color-scheme: dark) {
    .stage-card {
        border-color: var(--border-color);
    }
}

/* ============================================
   ACTIVE STAGE CARD (single in-place card)
   ============================================ */

.active-stage-card {
    background: var(--bg-secondary, #f8f9fa);
    border: 1px solid var(--border-light, #e0e0e0);
    border-left: 4px solid var(--primary-color, #6366f1);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.active-stage-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.active-stage-progress-bar {
    background: var(--border-light, #e0e0e0);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.active-stage-progress-fill {
    height: 100%;
    background: var(--primary-color, #6366f1);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.active-stage-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.active-stage-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-stage-complete {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-stage-complete-icon {
    font-size: 1.1rem;
}

.active-stage-complete-label {
    font-weight: 600;
    color: var(--success-color, #22c55e);
}

.active-stage-complete-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* ============================================
   RESULTS STYLES
   ============================================ */

.results-summary {
    margin-bottom: 32px;
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-light);
}

.summary-header h3 {
    color: var(--success-color);
    font-size: 1.5rem;
    margin: 0;
}

.completion-time {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.stat-card {
    background-color: var(--bg-secondary);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-light);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.download-section {
    background-color: var(--bg-secondary);
    padding: 28px;
    border-radius: 12px;
    margin-top: 24px;
}

.download-section h3 {
    margin-bottom: 8px;
}

.download-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.download-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.results-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.download-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background-color: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.download-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.download-icon {
    font-size: 2rem;
}

.download-label {
    font-weight: 600;
    font-size: 1rem;
}

/* ============================================
   RECOMMENDATIONS STYLES
   ============================================ */

.recommendations-section {
    background-color: var(--bg-secondary);
    padding: 28px;
    border-radius: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
    border: 2px solid var(--border-color);
}

.recommendations-section h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.recommendations-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--warning-color), var(--warning-light));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.badge-icon {
    font-size: 1rem;
}

.recommendations-content {
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: 10px;
    border: 2px solid var(--border-light);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.recommendations-content::selection {
    background: transparent;
}

.recommendations-content::-moz-selection {
    background: transparent;
}

.recommendation-item {
    padding: 16px;
    margin-bottom: 12px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.recommendation-item:last-child {
    margin-bottom: 0;
}

.recommendation-item:hover {
    border-left-color: var(--primary-hover);
    transform: translateX(4px);
}

.recommendation-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95rem;
}

.key-finding {
    padding: 16px;
    margin-bottom: 12px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.key-finding:last-child {
    margin-bottom: 0;
}

.finding-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Disable right-click on recommendations */
.recommendations-content {
    -webkit-touch-callout: none;
}

/* ============================================
   MESSAGE STYLES
   ============================================ */

.error-message,
.success-message,
.warning-message,
.info-message {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.error-message::before {
    content: '❌';
    font-size: 1.2rem;
}

/* Job error panel — shown inline in the progress section on failure */
.job-error-panel {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 24px;
    padding: 20px 24px;
    background-color: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

.job-error-icon {
    font-size: 1.5rem;
    color: var(--error-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.job-error-body {
    flex: 1;
}

.job-error-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.job-error-message {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.job-error-retry {
    font-size: 0.875rem;
    padding: 8px 20px;
}

.success-message {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.success-message::before {
    content: '✅';
    font-size: 1.2rem;
}

.warning-message {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.warning-message::before {
    content: '⚠️';
    font-size: 1.2rem;
}

.info-message {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.info-message::before {
    content: 'ℹ️';
    font-size: 1.2rem;
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.main-footer {
    text-align: center;
    padding: 32px 0;
    margin-top: 48px;
    border-top: 2px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-content p {
    margin: 0;
}

.main-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.main-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.deployment-info {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.inflectra-logo {
    height: 42px !important;
    width: auto;
    transition: var(--transition);
    display: block;
}

/* Make logo white in dark mode */
@media (prefers-color-scheme: dark) {
    .inflectra-logo {
        filter: invert(100%) 
          /* Step 2: Remove any color from the inverted lines */
          brightness(100%) 
          contrast(100%) 
          grayscale(100%) 
          /* Step 3: Push everything to pure white */
          brightness(1000%);
        opacity: 0.9;
    }
    
    .inflectra-logo:hover {
        opacity: 1;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-secondary);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .main-header {
        padding: 28px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo-section h1 {
        font-size: 2.25rem;
    }

    .user-info-display {
        width: 100%;
    }

    .card {
        padding: 24px;
    }

    .card h2 {
        font-size: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .download-links {
        grid-template-columns: 1fr;
    }

    .summary-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    /* Prevent stage duration from overflowing on small screens */
    .stage-duration {
        font-size: 0.75rem;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .main-header {
        padding: 24px;
    }

    .logo-section h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .card {
        padding: 20px;
        margin-bottom: 16px;
    }

    .card h2 {
        font-size: 1.35rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .download-link {
        padding: 20px;
    }

    .download-icon {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }
    
    .footer-content {
        gap: 12px;
    }
    
    .footer-logo {
        flex-direction: column;
        gap: 8px;
    }
    
    .inflectra-logo {
        height: 36px !important;
    }
}

/* Large screens (1200px and above) */
@media (min-width: 1200px) {
    .container {
        max-width: 1100px;
    }

    .card {
        padding: 36px;
    }

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

/* Print styles */
@media print {
    body {
        background-color: white;
        padding: 0;
    }

    .main-header,
    .main-footer,
    #api-key-section,
    #config-section,
    .btn-primary,
    .btn-secondary {
        display: none;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #333;
    }

    .card {
        border: 2px solid var(--border-color);
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        border-width: 2px;
    }
}

/* Request Body Template Examples */
.template-examples {
    margin-top: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.template-examples summary {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
    user-select: none;
    background-color: var(--bg-secondary);
}

.template-examples summary:hover {
    background-color: var(--bg-color);
}

.template-examples-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.template-example strong {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.template-example pre {
    margin: 0;
    padding: 8px 10px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
    cursor: pointer;
}

.template-example pre:hover {
    border-color: var(--primary-light);
    background-color: rgba(79, 70, 229, 0.04);
}

@media (prefers-color-scheme: dark) {
    .template-example pre {
        background-color: rgba(0, 0, 0, 0.3);
    }
}

/* ===== Login Page Marketing Content ===== */
.login-marketing {
    margin-bottom: 1.5rem;
}

.login-headline {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a2e);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.login-description {
    color: var(--text-secondary, #555);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary, #555);
    line-height: 1.4;
}

.login-features li::before {
    content: "✓";
    color: var(--accent-color, #6366f1);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.login-divider {
    border-top: 1px solid var(--border-color, #e5e7eb);
    margin: 1.5rem 0;
}

.login-form-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: var(--text-primary, #1a1a2e);
}

.beta-signup-link {
    margin-top: 1rem;
    text-align: center;
}

.beta-signup-link a {
    font-size: 0.875rem;
    color: var(--accent-color, #6366f1);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.beta-signup-link a:hover {
    opacity: 1;
    text-decoration: underline;
}

.beta-signup-link a:empty {
    display: none;
}

/* Dark mode overrides for login marketing */
@media (prefers-color-scheme: dark) {
    .login-headline {
        color: var(--text-primary-dark, #f0f0f0);
    }

    .login-description,
    .login-features li {
        color: var(--text-secondary-dark, #aaa);
    }

    .login-divider {
        border-color: var(--border-color-dark, #333);
    }

    .login-form-title {
        color: var(--text-primary-dark, #f0f0f0);
    }
}

/* ============================================
   HELP FAB (Floating Action Button)
   ============================================ */

.help-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(211, 60, 101, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-fab:hover {
    transform: translateY(-3px) scale(1.07);
    box-shadow: 0 8px 24px rgba(211, 60, 101, 0.55);
}

.help-fab:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px rgba(211, 60, 101, 0.4);
}

.help-fab:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

/* ============================================
   HELP MODAL
   ============================================ */

.help-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.help-modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 1100px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.25s ease;
    border: 1px solid var(--border-color);
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.help-modal-title {
    color: white;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.help-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.help-modal-close:focus {
    outline: 3px solid white;
    outline-offset: 2px;
}

.help-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    color: var(--text-primary);
}

/* Help modal intro text */
.help-modal-intro {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Help flow cards */
.help-flow {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.help-flow:last-of-type {
    margin-bottom: 0;
}

.help-flow-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.help-flow-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.help-flow-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.help-flow-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-flow-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.help-step-num {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.help-flow-when {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-style: italic;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 4px;
}

.help-modal-footer {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    font-style: italic;
}

/* Help flows grid — 3 columns on wide, 2 on medium, 1 on mobile */
.help-flows-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 0;
}

.help-flows-grid .help-flow {
    margin-bottom: 0;
}

/* Two columns on medium screens */
@media (max-width: 900px) {
    .help-flows-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Stack flows vertically on mobile */
@media (max-width: 600px) {
    .help-flows-grid {
        grid-template-columns: 1fr;
    }
}

/* Close animation for modal */
.help-modal-overlay.is-closing {
    animation: fadeOut 0.2s ease forwards;
}

.help-modal-overlay.is-closing .help-modal-content {
    animation: scaleOut 0.2s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes scaleOut {
    from { transform: scale(1);    opacity: 1; }
    to   { transform: scale(0.95); opacity: 0; }
}

/* Open animation for modal content */
@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.help-modal-content {
    animation: scaleIn 0.25s ease;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .help-modal-overlay {
        background: rgba(0, 0, 0, 0.7);
    }

    .help-flow {
        border-color: var(--border-color);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .help-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .help-modal-content {
        max-height: 92vh;
    }

    .help-modal-header {
        padding: 18px 20px 16px;
    }

    .help-modal-body {
        padding: 18px 20px;
    }

    .help-modal-title {
        font-size: 1.15rem;
    }
}

/* ===== Example Interactions Section ===== */
.examples-section {
    margin-top: 1.5rem;
}

.examples-description {
    color: var(--text-secondary, #6b7280);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.examples-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.example-card {
    border-radius: 8px;
    border-left: 4px solid #9ca3af;
    background: var(--card-bg, #fff);
    padding: 1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}

.example-card--good {
    border-left-color: #22c55e;
    background: var(--example-good-bg, #f0fdf4);
}

.example-card--bad {
    border-left-color: #f59e0b;
    background: var(--example-bad-bg, #fffbeb);
}

.example-card--neutral {
    border-left-color: #6366f1;
}

.example-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.example-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(0,0,0,0.06);
}

.example-card--good .example-badge {
    background: #dcfce7;
    color: #166534;
}

.example-card--bad .example-badge {
    background: #fef3c7;
    color: #92400e;
}

.example-score {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-left: auto;
}

.example-field {
    margin-bottom: 0.6rem;
}

.example-field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.2rem;
}

.example-text {
    font-size: 0.9rem;
    color: var(--text-primary, #111827);
    white-space: pre-wrap;
    word-break: break-word;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    line-height: 1.5;
}

.example-reasoning {
    font-size: 0.82rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.06);
}

.example-strengths,
.example-weaknesses {
    font-size: 0.82rem;
    color: var(--text-secondary, #6b7280);
    margin-top: 0.3rem;
}

.example-strengths strong { color: #166534; }
.example-weaknesses strong { color: #92400e; }

.example-expand-btn {
    background: none;
    border: none;
    color: var(--primary, #6366f1);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0.25rem 0;
    margin-top: 0.5rem;
    text-decoration: underline;
}

.example-expand-btn:hover {
    opacity: 0.8;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .example-card {
        background: var(--card-bg, #1f2937);
    }
    .example-card--good {
        background: rgba(34, 197, 94, 0.08);
    }
    .example-card--bad {
        background: rgba(245, 158, 11, 0.08);
    }
    .example-card--good .example-badge {
        background: rgba(34, 197, 94, 0.2);
        color: #86efac;
    }
    .example-card--bad .example-badge {
        background: rgba(245, 158, 11, 0.2);
        color: #fcd34d;
    }
    .example-text {
        background: rgba(255,255,255,0.05);
        color: var(--text-primary, #f9fafb);
    }
    .example-strengths strong { color: #86efac; }
    .example-weaknesses strong { color: #fcd34d; }
}

/* ===== Full Report Panel ===== */
.full-report-section {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.full-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.full-report-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.copy-report-btn {
    padding: 6px 14px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    background-color: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.copy-report-btn:hover {
    background-color: var(--accent-color, #6366f1);
    color: #fff;
    border-color: var(--accent-color, #6366f1);
}

.copy-report-btn.copied {
    background-color: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

.full-report-text {
    margin: 0;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 500px;
    overflow-y: auto;
}

/* ID-based selectors for report panel (mirrors class-based styles above) */
#full-report-panel {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
}

/* HTML report body (replaces pre) */
#full-report-text.full-report-body {
    font-family: inherit;
    white-space: normal;
    background-color: var(--bg-secondary, #f8fafc);
    padding: 24px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-primary);
    max-height: none;
}

/* Score summary strip */
.score-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.25rem;
}

.score-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 110px;
}

.score-val {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}

.score-lbl {
    font-size: 0.72rem;
    color: var(--text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
    text-align: center;
}

/* Detail scores section (category & dimension breakdowns) */
.detail-scores-section {
    margin-bottom: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border-color, #e2e8f0);
}

.detail-scores-label {
    font-size: 0.72rem;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.6rem;
}

.detail-scores-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.score-card--detail {
    padding: 8px 14px;
    min-width: 90px;
    opacity: 0.85;
}

.score-val--detail {
    font-size: 1.15rem;
}

/* Report section styles */
.rpt-section {
    margin-bottom: 1.75rem;
}

.rpt-heading {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-primary);
}

.rpt-summary {
    margin: 0;
    color: var(--text-secondary, #475569);
    line-height: 1.7;
}

.rpt-score-line {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.rpt-explanation {
    margin: 0.5rem 0 0;
    color: var(--text-secondary, #475569);
    font-style: italic;
    font-size: 0.875rem;
}

.rpt-list {
    margin: 0;
    padding-left: 1.4rem;
}

.rpt-list li {
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.rpt-issues li {
    color: var(--text-secondary, #475569);
}

.rpt-rec-item {
    margin-bottom: 0.75rem;
}

/* Category score table */
.rpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.rpt-table th {
    text-align: left;
    font-weight: 600;
    padding: 4px 8px;
    color: var(--text-secondary, #64748b);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.rpt-cat-name {
    padding: 5px 8px;
    white-space: nowrap;
    width: 160px;
    color: var(--text-primary);
}

.rpt-bar-cell {
    padding: 5px 8px;
    width: 100%;
}

.rpt-bar-bg {
    background: var(--border-color, #e2e8f0);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}

.rpt-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.rpt-cat-pct {
    padding: 5px 8px;
    white-space: nowrap;
    font-weight: 600;
    text-align: right;
    width: 56px;
}

/* Dark mode support for report panel */
@media (prefers-color-scheme: dark) {
    #full-report-panel {
        border-color: var(--border-color, #374151);
    }

    #full-report-text {
        background-color: var(--bg-secondary, #111827);
        color: var(--text-primary, #f9fafb);
    }

    .full-report-text {
        background-color: var(--bg-secondary, #111827);
        color: var(--text-primary, #f9fafb);
    }

    .full-report-section {
        border-color: var(--border-color, #374151);
    }

    .score-card {
        background: var(--bg-secondary, #1e293b);
        border-color: var(--border-color, #374151);
    }

    .rpt-bar-bg {
        background: var(--border-color, #374151);
    }
}

/* ============================================
   BETA SIGNUP — HOME PAGE TWO-PANEL LAYOUT
   ============================================ */

/* Beta badge pill in the header h1 */
.beta-badge {
    display: inline-block;
    font-size: 0.55em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    padding: 0.15em 0.65em;
    vertical-align: middle;
    margin-left: 0.4em;
    line-height: 1.6;
}

/* Pre-production notice banner */
.pre-production-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-left: 4px solid var(--warning-color);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 28px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notice-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
    .pre-production-notice {
        background-color: rgba(245, 158, 11, 0.1);
        border-color: rgba(245, 158, 11, 0.3);
        color: var(--text-secondary);
    }
}

/* Two-panel home layout */
.home-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 32px;
}

/* Left: marketing panel */
.marketing-panel {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 0;
}

.marketing-headline {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.25;
}

.marketing-subheadline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.marketing-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.marketing-bullets li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.975rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.marketing-bullets li::before {
    content: "✓";
    color: var(--success-color);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.05em;
}

/* Right: forms panel */
.forms-panel {
    flex: 0 0 420px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Form cards — shared base */
.form-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 28px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.form-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.form-card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Registration card — slightly elevated, primary accent */
.registration-card {
    border-top: 3px solid var(--primary-color);
    border-radius: 14px 14px 0 0;
    box-shadow: var(--shadow-lg);
}

/* Login card — subtler, secondary style */
.login-card {
    background: var(--bg-secondary);
    border-top: none;
    border-radius: 0 0 14px 14px;
    box-shadow: var(--shadow);
}

@media (prefers-color-scheme: dark) {
    .login-card {
        background: var(--bg-secondary);
    }
}

/* Divider between registration and login cards */
.forms-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

.forms-divider::before,
.forms-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.forms-divider span {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    padding: 10px 0;
}

/* Full-width button modifier */
.btn-full {
    width: 100%;
}

/* Inline field error messages */
.field-error {
    display: none;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--error-color);
    font-weight: 500;
    line-height: 1.4;
}

.field-error:not(:empty) {
    display: block;
    padding: 6px 10px;
    background-color: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--error-color);
    border-radius: 0 6px 6px 0;
    animation: slideDown 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .field-error:not(:empty) {
        background-color: rgba(239, 68, 68, 0.12);
    }
}

/* General form-level error (below the form) */
.form-error {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    background-color: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--error-color);
    font-weight: 500;
    animation: slideDown 0.2s ease;
}

.form-error:not(:empty) {
    display: block;
}

/* Success confirmation message (replaces form in-place) */
.registration-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 32px 16px;
    animation: fadeIn 0.4s ease;
}

.success-icon {
    font-size: 3rem;
    line-height: 1;
}

.registration-success p {
    font-size: 1.05rem;
    color: var(--success-color);
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   RESPONSIVE — HOME LAYOUT
   ============================================ */

/* Tablet and below: stack panels vertically */
@media (max-width: 768px) {
    .home-layout {
        flex-direction: column;
        gap: 24px;
    }

    .forms-panel {
        flex: none;
        width: 100%;
    }

    .marketing-panel {
        padding: 0;
    }

    .marketing-headline {
        font-size: 1.45rem;
    }

    .form-card {
        padding: 22px;
    }

    .registration-card {
        border-radius: 14px 14px 0 0;
    }

    .login-card {
        border-radius: 0 0 14px 14px;
    }
}

@media (max-width: 480px) {
    .home-layout {
        gap: 16px;
    }

    .marketing-headline {
        font-size: 1.25rem;
    }

    .marketing-subheadline {
        font-size: 0.95rem;
    }

    .form-card {
        padding: 18px;
    }

    .form-card-title {
        font-size: 1.1rem;
    }

    .pre-production-notice {
        font-size: 0.85rem;
        padding: 10px 14px;
    }
}

/* Wide screens: cap forms panel width */
@media (min-width: 1200px) {
    .forms-panel {
        flex: 0 0 460px;
    }

    .home-layout {
        gap: 48px;
    }
}

/* ============================================
   SCENARIO MODE — MODE SELECTOR (three tabs)
   ============================================ */

.mode-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 6px;
    border: 1px solid var(--border-light);
}

.mode-tab {
    flex: 1 1 auto;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    background: transparent;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

.mode-tab:hover {
    background: var(--card-bg);
    color: var(--text-primary);
}

.mode-tab--active,
.mode-tab[aria-pressed="true"] {
    background: var(--card-bg);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.mode-tab:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* On narrow screens, allow tabs to wrap to two rows */
@media (max-width: 600px) {
    .mode-tab {
        padding: 9px 10px;
        font-size: 0.85rem;
    }
}

@media (prefers-color-scheme: dark) {
    .mode-selector {
        border-color: var(--border-color);
    }

    .mode-tab--active,
    .mode-tab[aria-pressed="true"] {
        background: var(--bg-color);
    }
}

/* ============================================
   CONSENT / AUTHORIZATION NOTICES
   ============================================ */

.consent-notice {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 12px;
    margin-bottom: 12px;
}

.consent-notice p {
    margin: 0;
}

/* ============================================
   SCENARIO MODE — CARDS GRID
   ============================================ */

.scenario-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .scenario-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   SCENARIO MODE — INDIVIDUAL CARD
   ============================================ */

.scenario-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    position: relative;
    user-select: none;
}

.scenario-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.scenario-card:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.scenario-card__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.scenario-card__description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Selected state */
.scenario-card--selected,
.scenario-card[aria-selected="true"] {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(211, 60, 101, 0.06), rgba(168, 45, 79, 0.06));
    box-shadow: 0 0 0 3px rgba(211, 60, 101, 0.15);
}

.scenario-card--selected .scenario-card__name,
.scenario-card[aria-selected="true"] .scenario-card__name {
    color: var(--primary-color);
}

/* Disabled state */
.scenario-card--disabled,
.scenario-card[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    border-style: dashed;
}

.scenario-card--disabled:hover,
.scenario-card[aria-disabled="true"]:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-color);
}

@media (prefers-color-scheme: dark) {
    .scenario-card--selected,
    .scenario-card[aria-selected="true"] {
        background: linear-gradient(135deg, rgba(211, 60, 101, 0.12), rgba(168, 45, 79, 0.12));
    }
}

/* ============================================
   SCENARIO MODE — ACTIONS ROW
   ============================================ */

.scenario-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.scenario-actions .btn-primary,
.scenario-actions .btn-secondary {
    flex: 1;
    min-width: 140px;
}

@media (max-width: 480px) {
    .scenario-actions {
        flex-direction: column;
    }

    .scenario-actions .btn-primary,
    .scenario-actions .btn-secondary {
        width: 100%;
    }
}

/* ============================================
   SCENARIO MODE — PREVIEW BANNER
   ============================================ */

.preview-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05));
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-left: 4px solid var(--accent-color);
    border-radius: 10px;
    padding: 12px 18px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.5;
}



@media (prefers-color-scheme: dark) {
    .preview-banner {
        background: rgba(6, 182, 212, 0.08);
        border-color: rgba(6, 182, 212, 0.25);
        color: var(--text-secondary);
    }
}

/* ============================================
   ACCESSIBILITY — SCREEN READER ONLY
   ============================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
