/**
 * Idea Validator Template Styles
 *
 * Lead generation page for AI idea validation.
 * Uses Exponentially design system variables from variables.css.
 * Updated 2026-01-28: Split-screen layout matching Login/Register pages.
 *
 * @package Exponentially
 */

/* ==========================================================================
   Split-Screen Auth Container Layout
   ========================================================================== */

.idea-validator-auth-container {
    display: flex;
    min-height: 100vh;
}

.idea-validator-auth-container .brand-panel {
    width: 50%;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.5rem 3rem;
    overflow-y: auto;
}

.idea-validator-right-panel {
    width: 50%;
    background: #FFFFFF;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
    min-height: 100vh;
}

/* ==========================================================================
   Layout & Container (Right Panel Content)
   ========================================================================== */

.idea-validator-page {
    min-height: auto;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.idea-validator-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* ==========================================================================
   Sections (Step visibility)
   ========================================================================== */

.idea-validator-section {
    display: none;
}

.idea-validator-section.active {
    display: block;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.idea-validator-card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    border-radius: 0.5rem; /* --radius-lg = 8px */
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.idea-validator-card:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

.idea-validator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.idea-validator-logo {
    height: 40px;
    width: auto;
    margin-bottom: 1.5rem;
}

.idea-validator-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 0.75rem 0;
    line-height: 1.25;
}

.idea-validator-subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   Form Elements
   ========================================================================== */

.idea-validator-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.field-hint {
    font-size: 0.875rem;
    color: #6B6B6B;
    margin: 0;
    line-height: 1.5;
}

/* Textarea */
.idea-validator-form textarea {
    width: 100%;
    min-height: 150px;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text-primary);
    background: var(--color-bg-white);
    border: 2px solid #C84A2C;
    border-radius: 0.375rem; /* --radius-md = 6px */
    resize: vertical;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.idea-validator-form textarea:focus {
    outline: none;
    border-color: #C84A2C;
    box-shadow: 0 0 0 3px rgba(200, 74, 44, 0.15);
}

.idea-validator-form textarea::placeholder {
    color: var(--color-text-tertiary);
}

/* Email input */
.email-capture-form input[type="email"] {
    width: 100%;
    height: 2.5rem; /* 40px */
    padding: 0 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text-primary);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-default);
    border-radius: 0.375rem; /* --radius-md = 6px */
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.email-capture-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.email-capture-form input[type="email"]::placeholder {
    color: var(--color-text-tertiary);
}

/* ==========================================================================
   Character Counter
   ========================================================================== */

.character-counter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0.375rem;
}

.character-counter-text {
    font-size: 0.75rem;
    color: #6B6B6B;
    white-space: nowrap;
    transition: color 150ms ease;
}

.character-counter-row.met-minimum .character-counter-text {
    color: #16A34A;
}

.char-minimum {
    transition: color 150ms ease;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem; /* 40px */
    padding: 0 1.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-white);
    background: var(--color-primary); /* #C84A2C */
    border: none;
    border-radius: 0.375rem; /* --radius-md = 6px */
    cursor: pointer;
    transition: background-color 150ms ease, opacity 150ms ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.btn-primary:disabled {
    background: var(--color-primary-disabled);
    cursor: not-allowed;
}

/* Idea Validator: Disabled button should still look like a branded CTA */
#generate-btn:disabled {
    background: #F5E6E2 !important;
    border: 2px solid #C84A2C !important;
    color: #8F2F1C !important;
    cursor: default;
}

/* ==========================================================================
   Character Progress Bar
   Visual progress toward minimum characters
   ========================================================================== */

.char-progress-container {
    flex: 1;
    height: 4px;
    background: #E4E4E7;
    border-radius: 2px;
    overflow: hidden;
}

.char-progress-bar {
    height: 100%;
    width: 0%;
    background: #C84A2C;
    border-radius: 2px;
    transition: width 0.15s ease, background-color 0.15s ease;
}

.char-progress-bar.complete {
    background: #16A34A;
}

/* Button ready state pulse */
#generate-btn.ready {
    animation: btn-ready-pulse 0.4s ease-out;
}

@keyframes btn-ready-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(200, 74, 44, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 8px rgba(200, 74, 44, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(200, 74, 44, 0);
    }
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.5rem; /* 40px */
    padding: 0 1.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    background: transparent;
    border: 1px solid var(--color-border-default);
    border-radius: 0.375rem; /* --radius-md = 6px */
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
    text-decoration: none;
    white-space: nowrap;
}

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

/* Loading state on buttons */
.btn-primary.loading,
.btn-secondary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after,
.btn-secondary.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

.btn-primary.loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-text-white);
}

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

/* ==========================================================================
   reCAPTCHA Notice
   ========================================================================== */

.recaptcha-notice {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    text-align: center;
}

/* ==========================================================================
   Output Preview Strip (below Generate button)
   ========================================================================== */

.output-preview-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0;
    flex-wrap: wrap;
}

.output-preview-label {
    font-size: 0.75rem;
    color: #A1A1AA;
    font-weight: 500;
}

.output-preview-items {
    display: flex;
    gap: 0.75rem;
}

.output-preview-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6B6B6B;
    font-weight: 500;
}

.output-preview-item svg {
    color: #C84A2C;
    flex-shrink: 0;
}

/* ==========================================================================
   Progressive Results Section
   ========================================================================== */

.results-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.results-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1A1A1A;
    margin: 0;
}

/* ==========================================================================
   Reveal Cards
   ========================================================================== */

.reveal-card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-light);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.625rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.reveal-card--in {
    opacity: 1;
    transform: translateY(0);
}

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

.reveal-card-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.reveal-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reveal-badge {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-success);
    background: var(--color-success-bg);
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
}

.reveal-card-body {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.reveal-card-body p {
    margin: 0 0 0.5rem 0;
}

.reveal-card-body p:last-child {
    margin-bottom: 0;
}

/* Reveal spinner for current processing step */
.reveal-spinner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.reveal-spinner-dot {
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: revealSpin 0.8s linear infinite;
    flex-shrink: 0;
}

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

/* Email capture card within results */
.reveal-email-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    border-top: 3px solid var(--color-primary);
    text-align: center;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Inline Email Capture
   ========================================================================== */

.inline-email-capture {
    border-top: 1px solid var(--color-border-light);
    padding-top: 1.25rem;
    text-align: center;
}

.email-capture-prompt {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0 0 0.75rem 0;
}

.email-capture-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.email-input-row {
    display: flex;
    gap: 0.5rem;
}

.email-input-row input[type="email"] {
    flex: 1;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--color-text-primary);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border-default);
    border-radius: 0.375rem;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    min-width: 0;
}

.email-input-row input[type="email"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.email-input-row input[type="email"]::placeholder {
    color: var(--color-text-tertiary);
}

.email-input-row .btn-primary {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==========================================================================
   Confirmation Section
   ========================================================================== */

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

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem auto;
    background: var(--color-success-bg);
    border-radius: 50%;
    color: var(--color-success);
}

.success-icon svg {
    width: 40px;
    height: 40px;
}

.confirmation-card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 0.75rem 0;
}

.confirmation-card > p {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0 0 1.5rem 0;
}

.confirmation-card .cta-message {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin: 0 0 1.5rem 0;
    padding: 1rem;
    background: var(--color-bg-secondary);
    border-radius: 0.5rem;
}

/* CTA Buttons */
.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cta-buttons .btn-primary {
    width: 100%;
}

.cta-buttons .btn-secondary {
    width: 100%;
}

/* ==========================================================================
   Error Messages
   ========================================================================== */

.error-message {
    padding: 0.75rem 1rem;
    background: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    border-radius: 0.375rem;
    color: var(--color-error);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.error-message.visible {
    display: block;
}

/* JavaScript-generated error messages */
.idea-validator-error,
.email-capture-error {
    padding: 0.75rem 1rem;
    background: var(--color-error-bg, #fef2f2);
    border: 1px solid var(--color-error-border, #fecaca);
    border-radius: 0.375rem;
    color: var(--color-error, #dc2626);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    animation: error-fade-in 200ms ease-out;
}

@keyframes error-fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet - Stack vertically */
@media (max-width: 1024px) {
    .idea-validator-auth-container {
        flex-direction: column;
    }

    .idea-validator-auth-container .brand-panel,
    .idea-validator-right-panel {
        width: 100%;
        min-height: auto;
    }

    .idea-validator-auth-container .brand-panel {
        position: static;
        height: auto;
        padding: 2rem;
        padding-top: 2rem;
    }

    .idea-validator-right-panel {
        padding: 2rem;
    }
}

/* Mobile - Hide brand panel completely */
@media (max-width: 768px) {
    .idea-validator-auth-container .brand-panel {
        display: none;
    }

    .idea-validator-right-panel {
        width: 100%;
        padding: 1.5rem;
    }

    .idea-validator-container {
        max-width: 100%;
    }

    .idea-validator-page {
        padding: 0;
    }

    .idea-validator-card {
        padding: 1.5rem;
    }

    .idea-validator-header h1 {
        font-size: 1.25rem;
    }

    .idea-validator-subtitle {
        font-size: 0.875rem;
    }

    .email-input-row {
        flex-direction: column;
    }

    .cta-buttons {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .idea-validator-right-panel {
        padding: 1rem;
    }

    .idea-validator-card {
        padding: 1.25rem;
    }

    .email-input-row {
        flex-direction: column;
    }
}

/* ==========================================================================
   Example Idea Chips
   ========================================================================== */

.idea-validator-chips {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.idea-validator-chips-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
}

.idea-validator-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.idea-validator-chip {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-primary);
    background: color-mix(in srgb, var(--color-primary) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
    border-radius: 1rem;
    cursor: pointer;
    transition: background 150ms;
    white-space: nowrap;
}

.idea-validator-chip:hover {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
}

/* ==========================================================================
   Step Tracker
   ========================================================================== */

.idea-validator-steps {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.iv-step {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-gray-300);
    transition: color 0.3s;
}

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

.iv-step-icon {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--color-gray-300);
    flex-shrink: 0;
    box-sizing: border-box;
}

.iv-step--active .iv-step-icon {
    width: 12px;
    height: 12px;
    border: 2px solid var(--color-primary);
    border-top-color: transparent;
    animation: revealSpin 0.8s linear infinite;
}

.iv-step--done {
    color: var(--color-success);
}

.iv-step--done .iv-step-icon {
    width: 12px;
    height: 12px;
    border: none;
    background: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2316A34A' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") no-repeat center/contain;
}

/* ==========================================================================
   Scrollable Results Container
   ========================================================================== */

.results-scroll-container {
    max-height: 560px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding-right: 4px;
}

.results-scroll-container::-webkit-scrollbar {
    width: 4px;
}

.results-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.results-scroll-container::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: 4px;
}

/* ==========================================================================
   Stacked Label/Value Fields (Summary)
   ========================================================================== */

.iv-stacked-field {
    margin-bottom: 0.625rem;
}

.iv-stacked-field:last-child {
    margin-bottom: 0;
}

.iv-stacked-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}

.iv-stacked-val {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* ==========================================================================
   Canvas Fields
   ========================================================================== */

.iv-canvas-field {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

.iv-canvas-field:last-child {
    border-bottom: none;
}

.iv-canvas-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1px;
}

.iv-canvas-val {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.45;
}

/* ==========================================================================
   Hypotheses
   ========================================================================== */

.iv-hyp {
    background: var(--color-bg-secondary);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.5rem;
}

.iv-hyp:last-of-type {
    margin-bottom: 0.25rem;
}

.iv-hyp-type {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.iv-hyp p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.iv-hyp-keyword {
    font-weight: 700;
    color: var(--color-text-primary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.iv-assumptions {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    border-left: 2px solid var(--color-border-light);
    padding-left: 0.5rem;
    margin: 0.375rem 0 0;
}

/* ==========================================================================
   Experiment
   ========================================================================== */

.iv-exp-method {
    display: inline-block;
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    color: var(--color-primary);
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 4px;
    padding: 1px 6px;
    margin-bottom: 0.375rem;
}

.iv-exp-title {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0.25rem 0 0.375rem;
}

.iv-exp-desc {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0 0 0.5rem;
}

.iv-exp-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.iv-exp-meta-item {
    flex: 1;
    min-width: 120px;
}

.iv-exp-meta-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1px;
}

.iv-exp-meta-val {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .reveal-card {
        transition: none;
    }

    .reveal-spinner-dot,
    .iv-step--active .iv-step-icon {
        animation: none;
    }
}

/* ==========================================================================
   Hide footer for embedded iframe context
   ========================================================================== */

.idea-validator-page ~ footer {
    display: none;
}
