/* Auth Page Styles */

/* Gradient Background */
.gradient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.gradient-svg {
    width: 100%;
    height: 100%;
}

/* Navigation */
.auth-nav {
    position: absolute;
    top: 2rem;
    left: 2rem;
}

.back-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--color-text-primary);
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Auth Card */
.auth-card {
    background: var(--color-background-card);
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--color-shadow-medium);
    width: 100%;
    max-width: 440px;
    padding: 3rem;
    margin-bottom: 3rem;
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.auth-logo-img {
    height: 60px;
    width: auto;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.auth-tagline {
    color: var(--color-text-secondary);
    font-size: 1rem;
}

/* Tab Navigation */
.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.tab-button {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-tertiary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-button.active {
    color: var(--color-text-primary);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
}

/* Forms */
.auth-form-container {
    animation: fadeIn 0.3s ease;
}

.auth-form-container.hidden {
    display: none;
}

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

/* Google Button */
.google-auth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--color-background-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.google-auth-button:hover {
    background: var(--color-background-hover);
    border-color: var(--color-border-dark);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--color-text-tertiary);
    font-size: 14px;
}

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

/* Form Groups */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-group input {
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-help {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

/* Remember Me / Forgot Password */
.form-remember {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: var(--color-text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.forgot-link {
    font-size: 14px;
    color: var(--color-info);
    text-decoration: none;
}

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

/* Submit Button */
.auth-submit-button {
    padding: 0.875rem 2rem;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.auth-submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

/* Footer */
.auth-footer {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 1.5rem;
}

.auth-footer a {
    color: var(--color-info);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Journey Progress */
.journey-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    background: var(--color-background-card);
    border-radius: 50px;
    box-shadow: 0 4px 20px var(--color-shadow-medium);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.step-icon {
    font-size: 1.5rem;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.step-label {
    font-size: 11px;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s;
}

.progress-step.completed .step-icon,
.progress-step.current .step-icon {
    opacity: 1;
}

.progress-step.current .step-label {
    opacity: 1;
    color: var(--color-primary);
    font-weight: 600;
}

.progress-line {
    width: 40px;
    height: 2px;
    background: var(--color-border);
    transition: background 0.3s;
}

.progress-line.completed {
    background: var(--color-primary);
}

.progress-line.active {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-border) 100%);
}

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

/* ===========================================
   WIZARD STAGES - Multi-step Sign Up Flow
   =========================================== */

/* Hide all wizard stages by default, show only active */
.wizard-stage {
    display: none;
}

.wizard-stage.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Wizard Stepper Navigation */
.wizard-stepper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.wizard-step.active,
.wizard-step.completed {
    opacity: 1;
}

.wizard-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
}

.wizard-step.active .wizard-step-circle {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.wizard-step.completed .wizard-step-circle {
    background: var(--color-success, #10B981);
    color: var(--color-text-inverse);
}

.wizard-step-label {
    font-size: 11px;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wizard-step-line {
    width: 40px;
    height: 2px;
    background: var(--color-border);
}

/* Wizard Stage Content */
.wizard-stage-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.wizard-stage-subtitle {
    font-size: 14px;
    color: var(--color-text-tertiary);
    margin-bottom: 1rem;
    text-align: center;
}

/* Policy Scroll Container (TOS & Privacy) */
.policy-scroll-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--color-background-card);
}

.policy-content {
    padding: 1rem;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}

.policy-content h1,
.policy-content h2,
.policy-content h3 {
    color: var(--color-text-primary);
    margin: 1rem 0 0.5rem;
}

.policy-content h1 { font-size: 1.1rem; }
.policy-content h2 { font-size: 1rem; }
.policy-content h3 { font-size: 0.9rem; }

.policy-content p {
    margin-bottom: 0.75rem;
}

/* Scroll Progress Bar */
.scroll-progress {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.scroll-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 2px;
    width: 0%;
    transition: width 0.2s;
}

/* Consent Checkboxes */
.wizard-consent-checkbox {
    padding: 1rem;
    background: var(--color-background-hover, #F9FAFB);
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
}

.wizard-consent-checkbox.locked {
    opacity: 0.6;
}

.consent-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.consent-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.scroll-hint {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Wizard Navigation Buttons */
.wizard-nav-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.wizard-nav-buttons .infitwin-button {
    flex: 1;
}

/* Success Screen */
.success-screen {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.success-message {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.success-redirect {
    font-size: 14px;
    color: var(--color-text-tertiary);
    font-style: italic;
}

/* ===========================================
   FIELD VALIDATION INDICATORS
   Uses design system colors from colors.css
   =========================================== */

/* Validation indicator container */
.validation-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 12px;
    font-weight: 500;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.validation-indicator.visible {
    opacity: 1;
}

/* Valid state - green checkmark */
.validation-indicator.valid {
    color: var(--color-success);
}

.validation-indicator.valid::before {
    content: '✓';
    font-weight: bold;
}

/* Invalid state - warning (amber) */
.validation-indicator.invalid {
    color: var(--color-warning-amber);
}

.validation-indicator.invalid::before {
    content: '⚠';
}

/* Input wrapper with indicator */
.infitwin-form__input-wrapper {
    position: relative;
}

/* Inline indicator for labels */
.infitwin-form__label .validation-indicator {
    position: absolute;
    right: 0;
    top: 0;
}

.infitwin-form__label {
    position: relative;
    display: flex;
    align-items: center;
}

/* Age checkbox validation */
.consent-checkbox-inline .validation-indicator {
    margin-left: 0.5rem;
}

/* ===========================================
   BUTTON VALIDATION STATES
   =========================================== */

/* Button muted state (has errors) */
.infitwin-button--validation-pending {
    background: var(--color-text-tertiary) !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

.infitwin-button--validation-pending:hover {
    background: var(--color-text-secondary) !important;
}

/* Button ready state (all valid) */
.infitwin-button--validation-ready {
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
    transform: scale(1.02);
    transition: all 0.3s ease !important;
}

.infitwin-button--validation-ready:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5) !important;
    transform: scale(1.04) translateY(-2px);
}

/* ===========================================
   ERROR FOCUS ANIMATION
   =========================================== */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--color-warning-amber); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { border-color: var(--color-warning-amber); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); }
}

.field-error-focus {
    animation: shake 0.4s ease, pulse-border 1s ease;
}

.field-error-focus .infitwin-form__input {
    border-color: var(--color-warning-amber) !important;
}

/* Checkbox shake */
.consent-checkbox-inline.field-error-focus {
    animation: shake 0.4s ease;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    padding: 0.5rem;
}

/* ===========================================
   VALID FIELD HIGHLIGHT
   =========================================== */

.infitwin-form__input.field-valid {
    border-color: var(--color-success);
}

.infitwin-form__input.field-invalid {
    border-color: var(--color-warning-amber);
}

/* Responsive */
@media (max-width: 640px) {
    .auth-card {
        padding: 2rem;
    }

    .journey-progress {
        transform: scale(0.8);
    }

    .wizard-stepper {
        gap: 0.25rem;
    }

    .wizard-step-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .wizard-step-line {
        width: 20px;
    }

    .policy-scroll-container {
        max-height: 250px;
    }
}