/**
 * 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;
}

.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: 1px solid var(--color-border-default);
    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: var(--color-primary);
    box-shadow: var(--focus-ring);
}

.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 {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    text-align: right;
}

.character-counter.below-minimum #char-count,
.character-counter.below-minimum .char-minimum {
    color: var(--color-error);
}

.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;
}

.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;
}

/* ==========================================================================
   Processing Section
   ========================================================================== */

#processing-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 0.5rem 0;
    text-align: center;
}

.processing-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0 0 1.5rem 0;
    text-align: center;
}

/* ==========================================================================
   Progress Checklist
   ========================================================================== */

.progress-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--color-bg-secondary);
    border-radius: 0.375rem;
    transition: background-color 200ms ease;
}

.progress-step.processing {
    background: linear-gradient(90deg, rgba(200, 74, 44, 0.08) 0%, #FFFFFF 100%);
    border-left: 3px solid #C84A2C;
    animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(200, 74, 44, 0);
    }
    50% {
        box-shadow: 0 0 12px 2px rgba(200, 74, 44, 0.15);
    }
}

.progress-step.complete {
    background: var(--color-success-bg);
}

/* Step icon - spinner by default, checkmark when completed */
.step-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Spinner for pending/processing state */
.progress-step:not(.complete) .step-icon::before {
    content: "";
    width: 18px;
    height: 18px;
    border: 2px solid var(--color-border-light);
    border-radius: 50%;
    opacity: 0.5;
}

.progress-step.processing:not(.complete) .step-icon::before {
    border-color: var(--color-primary);
    border-top-color: transparent;
    animation: step-spin 0.8s linear infinite;
    opacity: 1;
}

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

/* Checkmark for complete state */
.progress-step.complete .step-icon::before {
    content: "";
    width: 18px;
    height: 18px;
    background: var(--color-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-step.complete .step-icon::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 10px;
    border: solid var(--color-text-white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.progress-step.complete .step-icon {
    position: relative;
}

/* Checkmark animation */
@keyframes checkmark-appear {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
    }
    100% {
        transform: scale(1) rotate(45deg);
        opacity: 1;
    }
}

.progress-step.complete .step-icon::after {
    animation: checkmark-appear 300ms ease-out forwards;
}

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

/* ==========================================================================
   Preview Section
   ========================================================================== */

#preview-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0 0 1.5rem 0;
    text-align: center;
}

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

.result-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    border-radius: 0.5rem; /* --radius-lg = 8px */
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.result-card:last-of-type {
    margin-bottom: 0;
}

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

.result-content {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.result-content p {
    margin: 0 0 0.75rem 0;
}

.result-content p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Summary Preview (fade at bottom)
   ========================================================================== */

.summary-preview {
    position: relative;
    max-height: 180px;
    overflow: hidden;
}

.summary-preview::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: linear-gradient(to bottom, transparent, var(--color-bg-secondary));
    pointer-events: none;
}

/* ==========================================================================
   Locked Content Teasers
   ========================================================================== */

.locked-teasers {
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
}

.teasers-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
    margin: 0 0 0.75rem 0;
}

.teaser-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.teaser-row:last-child {
    margin-bottom: 0;
}

.teaser-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(200, 74, 44, 0.08);
    border-radius: 0.25rem;
    color: var(--color-primary);
}

.teaser-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.teaser-text strong {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.teaser-detail {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   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;
    }
}

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

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