/* ============================================================
   CLAREO CREATOR NETWORK — STYLES
   ============================================================ */

:root, [data-theme="dark"] {
    /* Swap base and ink for Clareo's dark creator interface */
    --base: #1E2026;      /* Premium deep black/charcoal */
    --ink: #FFFFFF;       /* Crisp white for text/borders */
    --safety: #FF3E00;    /* Signature Clareo Orange */
    --muted: #8E8E93;     /* Muted grey */
    --surface: #141416;   /* Subtle lighter surface for form containers */
    --surface-hover: #1E1E22; /* Hover card state */
    
    --border: 4px solid var(--ink);
    --border-thin: 1px solid rgba(255, 255, 255, 0.15);
    --border-hair: 1px solid rgba(255, 255, 255, 0.08);
    --shadow: 8px 8px 0px rgba(255, 255, 255, 0.95);
    --shadow-safety: 8px 8px 0px var(--safety);
}

/* Light Mode Override */
[data-theme="light"] {
    --base: #F5F5F0;
    --ink: #0A0A0B;
    --safety: #FF3E00;
    --muted: #6B6F76;
    --surface: #FFFFFF;
    --surface-hover: #EFEFEA;

    --border: 4px solid var(--ink);
    --border-thin: 1px solid rgba(0, 0, 0, 0.12);
    --border-hair: 1px solid rgba(0, 0, 0, 0.07);
    --shadow: 8px 8px 0px rgba(0, 0, 0, 0.85);
    --shadow-safety: 8px 8px 0px var(--safety);
}

/* Theme toggle button */
.theme-toggle-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}
[data-theme="light"] .theme-toggle-btn { border-color: rgba(0,0,0,0.12); }
.theme-toggle-btn:hover { color: var(--ink); background: var(--surface-hover); }

/* Base override to ensure full dark background */
body {
    background-color: var(--base);
    color: var(--ink);
}

.header__logo-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Selection Override */
::selection {
    background: var(--safety);
    color: #FFFFFF;
}

/* ============================================================
   ONBOARDING LAYOUT
   ============================================================ */

.creator-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-h);
}

.onboarding-container {
    flex: 1;
    display: grid;
    grid-template-columns: 360px 1fr;
    width: 100%;
    max-width: 100%; /* Optimized for full screen width */
    margin: 0 auto;
    border-left: none; /* Removed artificial boundaries */
    border-right: none;
}

/* --- Left Sidebar (Progress Track) --- */
.onboarding-sidebar {
    background: var(--base);
    border-right: var(--border-thin);
    padding: 3.5rem clamp(1.5rem, 3vw, 3rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
}

.onboarding-sidebar__intro {
    margin-bottom: 2rem;
}

.onboarding-sidebar__tag {
    color: var(--safety);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    display: block;
    margin-bottom: 0.8rem;
}

.onboarding-sidebar__title {
    font-size: 1.8rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.onboarding-sidebar__desc {
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.65;
    font-family: 'JetBrains Mono', monospace;
}

/* Progress List */
.progress-list {
    margin: 2.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.progress-list::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

/* Active progress track bar overlay */
.progress-track-bar {
    position: absolute;
    left: 9px;
    top: 5px;
    width: 2px;
    background: var(--safety);
    z-index: 2;
    transition: height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    height: 0%;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    position: relative;
    z-index: 3;
    cursor: pointer;
}

.progress-item__dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: var(--base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: bold;
    color: var(--muted);
    transition: all 0.3s ease;
}

.progress-item__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    transition: color 0.3s ease;
}

/* Active State */
.progress-item.active .progress-item__dot {
    border-color: var(--safety);
    color: var(--safety);
    box-shadow: 0 0 10px rgba(255, 62, 0, 0.3);
}
.progress-item.active .progress-item__label {
    color: var(--ink);
    font-weight: 500;
}

/* Completed State */
.progress-item.completed .progress-item__dot {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--base);
}
.progress-item.completed .progress-item__label {
    color: rgba(255, 255, 255, 0.5);
}

.onboarding-sidebar__footer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    opacity: 0.4;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Right Content Area --- */
.onboarding-content {
    padding: 4rem clamp(2rem, 6vw, 6rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 100%; /* Expand fully on larger screens */
    width: 100%;
}

/* ============================================================
   FORM COMPONENT STYLING
   ============================================================ */

.onboarding-step {
    display: none;
}

.onboarding-step.active {
    display: block;
    animation: stepFadeIn 0.4s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

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

.step-header {
    margin-bottom: 2.5rem;
}

.step-num {
    font-family: 'JetBrains Mono', monospace;
    color: var(--safety);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.step-title {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    line-height: 0.95;
    text-transform: uppercase;
}

.step-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    opacity: 0.5;
    margin-top: 0.8rem;
}

.form-group {
    margin-bottom: 2.2rem;
}

.form-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

.form-label .required-indicator {
    color: var(--safety);
    margin-left: 0.2rem;
}

.form-helper {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    opacity: 0.5;
    margin-top: 0.4rem;
    display: block;
}

/* Input Fields */
.input-text {
    width: 100%;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--ink);
    padding: 1rem 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    border-radius: 0;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}

.input-text:focus {
    border-color: var(--safety);
    background: var(--surface-hover);
    box-shadow: 0 0 12px rgba(255, 62, 0, 0.2);
}

.input-text::placeholder {
    color: var(--muted);
    opacity: 0.4;
    font-size: 0.8rem;
}

/* Premium Tags/Chips Selection (Checkboxes and Single selects) */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.7rem;
    margin-top: 0.5rem;
}

.option-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.9rem 1.2rem;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    text-transform: uppercase;
}

.option-card:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.option-card:active {
    transform: translateY(0);
}

.option-card.selected,
.option-card:has(input:checked) {
    border-color: var(--safety);
    background: rgba(255, 62, 0, 0.08);
}

.option-card__indicator {
    font-size: 0.75rem;
    opacity: 0.3;
    transition: opacity 0.2s, color 0.2s, transform 0.2s;
}

.option-card.selected .option-card__indicator,
.option-card:has(input:checked) .option-card__indicator {
    opacity: 1;
    color: var(--safety);
    transform: scale(1.1);
}

/* Hide raw checkbox/radio inputs but keep accessible */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Focus styling for keyboard accessibility */
.visually-hidden:focus-visible + .option-card,
.option-card:has(.visually-hidden:focus-visible) {
    border-color: var(--safety);
    box-shadow: 0 0 0 2px var(--safety);
}

/* Rating Scale (1-5) */
.rating-scale {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
    max-width: 520px;
    width: 100%;
}

.rating-btn {
    flex: 1;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.rating-btn:hover {
    border-color: var(--safety);
    transform: translateY(-3px);
}

.rating-btn.selected,
.rating-btn:has(input:checked) {
    background: var(--safety);
    border-color: var(--safety);
    color: #FFFFFF;
    box-shadow: 0 0 15px rgba(255, 62, 0, 0.35);
}

.rating-legend {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.6rem;
    max-width: 520px;
}

/* Conditional Inputs (e.g. Specify "Other") */
.conditional-field {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease, margin-top 0.35s ease;
    margin-top: 0;
}

.conditional-field.visible {
    max-height: 120px;
    opacity: 1;
    margin-top: 1rem;
}

/* --- Form Navigation Bar --- */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: var(--border-hair);
    gap: 1.5rem;
}

.form-navigation__btn-wrapper {
    display: flex;
    gap: 1rem;
}

/* Navigation Buttons override to use premium white styling */
.btn--navigation {
    min-width: 140px;
}

.btn--ghost.btn--navigation {
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 6px 6px 0px rgba(255, 255, 255, 0.15);
}
.btn--ghost.btn--navigation:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--base);
    box-shadow: 6px 6px 0px var(--ink);
}

.btn--primary.btn--navigation {
    border-color: var(--ink);
    box-shadow: var(--shadow);
}

.btn--primary.btn--navigation:hover {
    border-color: var(--ink);
    box-shadow: 12px 12px 0px var(--ink);
}

/* Disabled state */
.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================================================
   VALIDATION & FEEDBACK
   ============================================================ */

.error-message {
    color: var(--safety);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
    display: none;
    align-items: center;
    gap: 0.4rem;
}

.error-message.visible {
    display: flex;
    animation: errorSlideIn 0.25s ease-out forwards;
}

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

.input-text.error {
    border-color: var(--safety);
    background: rgba(255, 62, 0, 0.03);
}

/* Shaking animation for validation failures */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.shake-animation {
    animation: shake 0.35s ease-in-out;
}

/* ============================================================
   WARNING UX (DUPLICATE DETECTED)
   ============================================================ */

.warning-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
}

.warning-overlay.visible {
    display: flex;
}

.warning-box {
    background: var(--base);
    border: var(--border);
    box-shadow: var(--shadow-safety);
    max-width: 500px;
    width: 100%;
    padding: 2.5rem;
    position: relative;
    animation: modalPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.warning-box__icon {
    font-size: 2.5rem;
    color: var(--safety);
    margin-bottom: 1.2rem;
    display: block;
}

.warning-box__title {
    font-size: 1.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.warning-box__text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.warning-box__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================================
   LOADING STATE
   ============================================================ */

.loading-spinner {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--ink);
    animation: spin 0.8s linear infinite;
    margin-right: 0.6rem;
    vertical-align: middle;
}

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

/* ============================================================
   SUCCESS SCREEN
   ============================================================ */

.success-screen {
    text-align: center;
    max-width: 600px;
    margin: 4rem auto;
    padding: 3rem 1.5rem;
    animation: successFadeIn 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

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

.success-screen__icon {
    font-size: 4rem;
    color: var(--safety);
    margin-bottom: 2rem;
    display: block;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255,62,0,0)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 15px rgba(255,62,0,0.6)); }
}

.success-screen__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 0.9;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.success-screen__text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
    opacity: 0.8;
    margin-bottom: 3rem;
}

.success-screen__text p {
    margin-bottom: 1.2rem;
}

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

@media (max-width: 992px) {
    .onboarding-container {
        grid-template-columns: 1fr;
    }
    
    .onboarding-sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: var(--border-thin);
        padding: 3rem clamp(1.5rem, 4vw, 4rem);
    }
    
    .progress-list {
        flex-direction: row;
        margin: 1.5rem 0 0;
        gap: 0.8rem;
        flex-wrap: wrap;
    }
    
    .progress-list::before,
    .progress-track-bar {
        display: none; /* Hide linear bar on mobile wrapper grid */
    }
    
    .progress-item {
        gap: 0.5rem;
        flex: 1;
        min-width: 120px;
    }
    
    .progress-item__dot {
        width: 16px;
        height: 16px;
        font-size: 0.55rem;
    }
    
    .onboarding-content {
        padding: 2.5rem clamp(1.5rem, 4vw, 3rem);
    }
}

@media (max-width: 600px) {
    .onboarding-sidebar {
        padding: 2rem 1.2rem;
    }

    .onboarding-content {
        padding: 2rem 1.2rem; /* Recover margins for mobile edge-to-edge layout */
    }

    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .rating-scale {
        gap: 0.3rem;
    }
    
    .rating-btn {
        font-size: 1.15rem;
    }
    
    .form-navigation {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 1.2rem;
    }
    
    .form-navigation__btn-wrapper {
        flex-direction: column-reverse;
    }
    
    .btn--navigation {
        width: 100%;
    }
}
