/* ==========================================
   Reset & CSS Variables
   ========================================== */
:root {
    --bg-color: #160a2c;
    --card-bg: rgba(30, 16, 56, 0.7);
    --card-border: rgba(152, 0, 255, 0.15);
    --border-hover: rgba(152, 0, 255, 0.35);
    --text-primary: #ffffff;
    --text-secondary: #c9bede;
    --text-muted: #8d7ca6;
    --brand-indigo: #9800ff;
    --brand-purple: #b54eff;
    --brand-violet: #7800e6;
    --accent-emerald: #10b981;
    --error-red: #ef4444;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-color);
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Grid Pattern */
body::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(152, 0, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(152, 0, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
    pointer-events: none;
    z-index: -1;
}

/* Background Glow Effects */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.bg-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--brand-purple) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.bg-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--brand-violet) 0%, transparent 70%);
    top: 40%;
    right: -10%;
}

.bg-glow-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--brand-indigo) 0%, transparent 70%);
    bottom: -10%;
    left: 20%;
}

/* Typography */
h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* ==========================================
   Header / Navbar
   ========================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(22, 10, 44, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.15rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: -0.01em;
}

.brand-logo {
    height: 5.5rem;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.brand-icon {
    background: linear-gradient(135deg, var(--brand-purple) 0%, var(--brand-violet) 100%);
    color: white;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.25);
}

.brand-icon i {
    width: 1.15rem;
    height: 1.15rem;
}

.brand-text {
    color: var(--text-primary);
    font-weight: 800;
}

.subbrand-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-left: 0.25rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 0.5rem;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.close-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bold-date {
    color: var(--brand-indigo);
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: rgba(152, 0, 255, 0.12);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    border: 1px solid rgba(152, 0, 255, 0.25);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--accent-emerald);
    animation: beacon 2s infinite ease-in-out;
}

@keyframes beacon {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

/* ==========================================
   Layout Structures (Landing vs Portal)
   ========================================== */
.app-layout {
    display: grid;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    gap: 3rem;
    min-height: calc(100vh - 75px);
    transition: all 0.4s ease-in-out;
}

/* Landing Layout Mode */
.app-layout.view-landing {
    grid-template-columns: 1.2fr 0.8fr;
}

.app-layout.view-landing .sidebar {
    display: none;
}

.app-layout.view-landing .hero-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-layout.view-landing .form-column {
    display: block;
}

.app-layout.view-landing .form-step .step-title-portal {
    display: none;
}

.app-layout.view-landing .portal-action-bar {
    display: none;
}

/* Portal Layout Mode */
.app-layout.view-portal {
    grid-template-columns: 0.9fr 2.1fr;
}

.app-layout.view-portal .hero-column {
    display: none;
}

.app-layout.view-portal .sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.app-layout.view-portal .form-column {
    display: block;
}

.app-layout.view-portal .landing-centered-header {
    display: none !important;
}

.app-layout.view-portal .landing-form-header {
    display: none;
}

.app-layout.view-portal .landing-action-wrapper {
    display: none;
}

.app-layout.view-portal .portal-action-bar {
    display: flex;
}

/* ==========================================
   Hero Section Styling
   ========================================== */
.hero-column {
    max-width: 620px;
    padding-bottom: 2rem;
}

.hero-tagline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.9rem;
    border-radius: 2rem;
    border: 1px solid var(--card-border);
    margin-bottom: 2rem;
    width: fit-content;
}

.tag-dot {
    width: 6px;
    height: 6px;
    background-color: var(--brand-violet);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--brand-violet);
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.highlight-text {
    font-family: var(--font-heading);
    font-style: italic;
    font-weight: 300;
    background: linear-gradient(135deg, #ffffff 0%, #b54eff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.65;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    border-top: 1px solid var(--card-border);
    padding-top: 2.5rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #c9bede 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================
   Sidebar Styling
   ========================================== */
.sidebar {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 2rem 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: fit-content;
    position: sticky;
    top: 95px;
}

.progress-container {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.progress-percentage {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.progress-bar-wrapper {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-purple) 0%, var(--brand-violet) 100%);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.steps-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 2rem;
}

.step-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.75rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.step-nav-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.step-nav-icon i {
    width: 0.9rem;
    height: 0.9rem;
}

.step-nav-icon .icon-success {
    display: none;
}

.step-nav-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.step-nav-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.step-nav-subtitle {
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* Step Mapped States */
.step-nav-item.active {
    background-color: rgba(122, 111, 192, 0.07);
    border-color: rgba(122, 111, 192, 0.15);
}

.step-nav-item.active .step-nav-icon {
    background-color: var(--brand-indigo);
    border-color: var(--brand-indigo);
    color: white;
    box-shadow: 0 0 10px rgba(122, 111, 192, 0.35);
}

.step-nav-item.active .step-nav-title {
    color: var(--text-primary);
}

.step-nav-item.completed .step-nav-icon {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-emerald);
}

.step-nav-item.completed .step-nav-icon .icon-default {
    display: none;
}

.step-nav-item.completed .step-nav-icon .icon-success {
    display: block;
}

.step-nav-item.completed .step-nav-title {
    color: var(--text-secondary);
}

/* Tip Card */
.tip-card {
    background-color: rgba(245, 158, 11, 0.03);
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: 0.75rem;
    padding: 1.15rem;
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.tip-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.tip-text {
    font-size: 0.775rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==========================================
   Form Card & Fields Styling
   ========================================== */
.form-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Form Header (Landing View) */
.landing-form-header {
    margin-bottom: 2.25rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1.5rem;
}

.landing-form-header h2 {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.landing-form-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.landing-stepper-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-num-text {
    color: var(--brand-violet);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-name-text {
    color: var(--text-primary);
}

.landing-stepper-progress {
    display: flex;
    gap: 4px;
    width: 100%;
}

.progress-segment {
    flex: 1;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: 1.5px;
}

.progress-segment.active {
    background-color: var(--brand-violet);
}

/* Portal Mode Title */
.step-title-portal {
    margin-bottom: 2.25rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1.25rem;
}

.step-title-portal h3 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.step-title-portal p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Form Steps State Controls */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: cardReveal 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Field Groups & Labels */
.field-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #cbd5e1;
    letter-spacing: 0.015em;
}

.required {
    color: var(--error-red);
    margin-left: 0.15rem;
}

/* Input Fields Styling */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.8rem 1.25rem 0.8rem 2.85rem;
    background-color: rgba(30, 16, 56, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 0.6rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.925rem;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-textarea {
    padding: 0.9rem 1.15rem;
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

/* Select dropdown style override */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.input-wrapper:has(.form-select)::after {
    content: '';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-muted);
    pointer-events: none;
    transition: transform 0.2s ease;
}

.form-select:focus + .input-icon + ::after {
    border-top-color: var(--brand-indigo);
}

/* Focus and hover rules */
.form-input:hover, .form-select:hover, .form-textarea:hover {
    border-color: var(--border-hover);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    background-color: rgba(30, 16, 56, 0.8);
    border-color: var(--brand-indigo);
    box-shadow: 0 0 0 3px rgba(152, 0, 255, 0.2);
}

.form-input:focus + .input-icon,
.form-select:focus + .input-icon {
    color: var(--brand-indigo);
}

/* Custom Radio Controls */
.radio-group {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    user-select: none;
}

.radio-label input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.custom-radio {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background-color: rgba(255, 255, 255, 0.02);
    display: inline-block;
    position: relative;
    transition: all 0.2s ease;
}

.radio-label:hover .custom-radio {
    border-color: var(--border-hover);
}

.radio-label input:checked ~ .custom-radio {
    border-color: var(--brand-indigo);
    background-color: rgba(122, 111, 192, 0.1);
}

.radio-label input:checked ~ .custom-radio::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--brand-indigo);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-label input:checked ~ span {
    color: var(--text-primary);
}

/* Character Counters & Textarea Footers */
.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0.4rem;
}

.char-counter {
    font-size: 0.725rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: right;
    margin-left: auto;
}

/* Validation Errors */
.error-msg {
    display: block;
    color: var(--error-red);
    font-size: 0.725rem;
    margin-top: 0.45rem;
    font-weight: 500;
    min-height: 1rem;
}

.error-msg:empty {
    display: none !important;
    min-height: 0 !important;
    margin-top: 0 !important;
}

.form-input.invalid, .form-select.invalid, .form-textarea.invalid {
    border-color: var(--error-red) !important;
    background-color: rgba(239, 68, 68, 0.03) !important;
}

/* ==========================================
   Buttons & Toolbar Controls
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    outline: none;
}

.btn-primary-premium {
    background: linear-gradient(135deg, var(--brand-purple) 0%, var(--brand-violet) 100%);
    color: white;
    font-weight: 700;
    font-family: var(--font-heading);
    box-shadow: 0 4px 18px rgba(167, 139, 250, 0.2);
}

.btn-primary-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.35);
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* Landing action buttons */
.landing-action-wrapper {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.btn-begin-app {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.95rem;
}

/* Portal sticky-like action bar */
.portal-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--card-border);
}

.btn-back {
    padding: 0.75rem 1.25rem;
}

.btn-continue {
    padding: 0.75rem 1.5rem;
}

/* Autosaved Status Text widget */
.autosave-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.autosave-pulse {
    width: 6px;
    height: 6px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px var(--accent-emerald);
    animation: autosavePulse 2.5s infinite ease-in-out;
}

@keyframes autosavePulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.4); opacity: 1; }
}

/* ==========================================
   Upload Pitch Deck Component
   ========================================== */
.upload-tabs {
    display: flex;
    gap: 0.35rem;
    background-color: rgba(255, 255, 255, 0.02);
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.15rem;
    border: 1px solid var(--card-border);
    width: fit-content;
}

.upload-tab {
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    font-size: 0.775rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.upload-tab i {
    width: 0.9rem;
    height: 0.9rem;
}

.upload-tab.active {
    background-color: var(--brand-purple);
    color: white;
}

/* Drag-n-drop file zone styles */
.file-upload-zone {
    border: 2px dashed var(--card-border);
    background-color: rgba(255, 255, 255, 0.005);
    border-radius: 0.75rem;
    padding: 2.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
}

.file-upload-zone:hover, .file-upload-zone.dragover {
    border-color: var(--brand-indigo);
    background-color: rgba(122, 111, 192, 0.02);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upload-icon {
    width: 2.75rem;
    height: 2.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.file-upload-zone:hover .upload-icon {
    transform: translateY(-2px);
    color: var(--brand-indigo);
}

.upload-text-main {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.upload-text-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.15rem;
}

.btn-browse {
    background-color: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    font-size: 0.775rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--card-border);
    pointer-events: none;
}

/* File Selected Info Block */
.file-selected-info {
    display: none;
    align-items: center;
    text-align: left;
    gap: 0.85rem;
    background-color: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
}

.file-selected-info.active {
    display: flex;
}

.file-selected-info .success-icon {
    color: var(--accent-emerald);
    width: 1.75rem;
    height: 1.75rem;
}

.selected-file-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-all;
}

.selected-file-size {
    font-size: 0.725rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
}

.btn-remove-file {
    margin-left: auto;
    background-color: rgba(255, 255, 255, 0.04);
    border: none;
    color: var(--text-secondary);
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.btn-remove-file:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--error-red);
}

.btn-remove-file i {
    width: 0.9rem;
    height: 0.9rem;
}

/* Link URL Input Field */
.link-url-zone {
    display: none;
}

.link-url-zone.active {
    display: block;
}

.link-url-zone .form-input {
    padding-left: 2.85rem;
}

/* ==========================================
   Modals & Success Screen Dialog
   ========================================== */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 4, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #1e0c38;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    max-width: 480px;
    border-radius: 1.25rem;
    padding: 2.5rem;
    text-align: center;
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.modal-backdrop.active .modal-content {
    transform: scale(1);
}

.success-checkmark-wrapper {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.party-icon {
    width: 2.15rem;
    height: 2.15rem;
    color: var(--accent-emerald);
}

.modal-content h2 {
    font-size: 1.55rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.modal-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

.reference-box {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 1.15rem;
    border-radius: 0.6rem;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}

.ref-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ref-id {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    font-family: monospace;
    word-break: break-all;
    user-select: all;
    background: rgba(122, 111, 192, 0.08);
    padding: 0.3rem 0.65rem;
    border-radius: 0.3rem;
    border: 1px solid rgba(122, 111, 192, 0.15);
}

.btn-copy-ref {
    background: transparent;
    border: none;
    color: var(--brand-indigo);
    font-size: 0.775rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.2rem;
    transition: color 0.2s ease;
}

.btn-copy-ref:hover {
    color: var(--brand-violet);
}

.btn-copy-ref i {
    width: 0.85rem;
    height: 0.85rem;
}

.modal-subtext {
    font-size: 0.775rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 1.75rem !important;
}

.btn-modal-close {
    width: 100%;
    padding: 0.75rem;
}

/* ==========================================
   Toast Notification Overlay
   ========================================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    background-color: #1e0c38;
    border: 1px solid #3d246c;
    padding: 0.85rem 1.35rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: all 0.3s ease;
}

.toast.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.toast-spinner {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--brand-indigo);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.toast-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

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

/* ==========================================
   Footer
   ========================================== */
.footer {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.775rem;
    font-weight: 500;
    border-top: 1px solid var(--card-border);
}

/* ==========================================
   Media Queries & Responsive Styling
   ========================================== */
@media (max-width: 992px) {
    .app-layout.view-landing {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding-top: 2rem;
    }
    
    .hero-column {
        max-width: 100%;
        text-align: center;
        align-items: center;
    }
    
    .hero-title {
        font-size: 2.85rem;
    }
    
    .hero-stats {
        max-width: 500px;
        width: 100%;
        margin: 0 auto;
    }
    
    .app-layout.view-portal {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 1.5rem;
    }
    
    .sidebar {
        position: static;
        top: 0;
        width: 100%;
    }
    
    .steps-checklist {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .step-nav-item {
        padding: 0.6rem;
    }
    
    .step-nav-details {
        display: none; /* Hide subtitles on tablet checklist to fit grid */
    }
    
    .step-nav-item.active .step-nav-details,
    .step-nav-item.completed .step-nav-details {
        display: flex;
    }
    
    .step-nav-subtitle {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.6rem 1rem;
    }
    
    .brand-logo {
        height: 4rem;
    }
    
    .close-date {
        display: none; /* Hide date on small phone screen navbar */
    }
    
    .app-layout {
        padding: 1.5rem 1rem;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .steps-checklist {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-card {
        padding: 1.75rem 1.25rem;
        border-radius: 0.9rem;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 0.85rem;
    }
    
    .portal-action-bar {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
    
    .autosave-indicator {
        order: -1;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .steps-checklist {
        grid-template-columns: 1fr;
    }
    
    .step-nav-details {
        display: flex !important;
    }
}

/* ==========================================
   Viewport Locking for Desktop (No Page Scrolling)
   ========================================== */
@media (min-width: 993px) {
    body {
        height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .navbar {
        flex-shrink: 0;
    }
    
    .app-layout {
        flex: 1;
        height: 0;
        min-height: 0;
        padding: 1.5rem 2rem;
        gap: 2rem;
    }
    
    .footer {
        flex-shrink: 0;
        padding: 1rem 2rem;
    }
    
    /* Columns inside landing view */
    .app-layout.view-landing .hero-column {
        height: 100%;
        overflow-y: auto;
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .app-layout.view-landing .form-column {
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
    }
    
    /* Columns inside portal view */
    .app-layout.view-portal .sidebar {
        height: 100%;
        overflow-y: auto;
        position: static;
    }
    
    .app-layout.view-portal .form-column {
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .form-card {
        max-height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    #startup-form {
        flex: 1;
        overflow-y: auto;
        padding-right: 0.5rem;
        min-height: 0;
    }
    
    /* Custom premium scrollbar for forms */
    #startup-form::-webkit-scrollbar {
        width: 6px;
    }
    #startup-form::-webkit-scrollbar-track {
        background: transparent;
    }
    #startup-form::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }
    #startup-form::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .portal-action-bar {
        flex-shrink: 0;
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    /* Compact layout adjustments to fit 6 questions on the landing screen */
    .app-layout.view-landing {
        padding: 2rem 3rem;
        gap: 2rem;
    }

    .app-layout.view-landing .form-card {
        padding: 2rem 2.5rem;
        border-radius: 1.25rem;
    }

    .app-layout.view-landing .landing-form-header {
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .app-layout.view-landing .landing-form-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }

    .app-layout.view-landing .landing-form-header p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .app-layout.view-landing .field-group {
        margin-bottom: 1.2rem;
    }

    .app-layout.view-landing .form-label {
        font-size: 0.95rem !important;
        margin-bottom: 0.5rem;
        font-weight: 600;
    }

    .app-layout.view-landing .form-input {
        padding: 0.85rem 1.25rem 0.85rem 2.75rem !important;
        font-size: 1.05rem !important;
        border-radius: 0.6rem !important;
    }

    .app-layout.view-landing .input-icon {
        left: 1rem !important;
        width: 1.1rem !important;
        height: 1.1rem !important;
    }

    .app-layout.view-landing .landing-action-wrapper {
        margin-top: 1.25rem;
    }

    .app-layout.view-landing .btn-begin-app {
        padding: 1rem 2rem !important;
        font-size: 1.1rem !important;
        border-radius: 0.6rem !important;
    }
}

/* ==========================================
   Landing Page Redesign (Light Lavender Theme)
   ========================================== */

/* Page-level changes for landing mode */
body:has(.view-landing),
body.landing-mode {
    --bg-color: #eae9f2 !important; /* Soft light lavender background */
    background-color: #eae9f2 !important;
    color: #1e293b !important;
    min-height: 100vh;
    overflow-y: auto !important; /* Enable scrolling */
    height: auto !important;
}

/* Hide background decorations in landing mode */
body:has(.view-landing)::before,
body.landing-mode::before,
body:has(.view-landing) .bg-glow,
body.landing-mode .bg-glow {
    display: none !important;
}

/* Hide navbar in landing mode to match template */
body:has(.view-landing) .navbar,
body.landing-mode .navbar {
    display: none !important;
}

/* Centered Layout for Landing Page */
.app-layout.view-landing {
    grid-template-columns: 1fr !important;
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 3rem 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    min-height: 100vh !important;
}

.app-layout.view-landing .hero-column {
    display: none !important;
}

.app-layout.view-landing .form-column {
    width: 100% !important;
    height: auto !important;
}

/* Centered Header outside Card */
.landing-centered-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.75rem;
}

.landing-logo {
    height: 4.5rem;
    width: auto;
    margin-bottom: 0.75rem;
    background: transparent;
    display: block;
    mix-blend-mode: multiply;
}

.landing-title {
    font-size: 4rem !important;
    font-weight: 700 !important;
    color: #1e1b4b; /* Deep purple/indigo */
    margin-bottom: 0.5rem;
    letter-spacing: normal !important;
    font-family: 'Dancing Script', cursive !important;
}

.landing-subtitle {
    font-size: 1.2rem !important;
    color: #475569; /* Slate secondary text */
}

/* Card layout overrides for Landing Mode */
body:has(.view-landing) .form-card,
body.landing-mode .form-card {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    max-height: none !important;
    height: auto !important;
    display: block !important;
    overflow: visible !important;
}

/* Hide form card inner landing header */
body:has(.view-landing) .landing-form-header,
body.landing-mode .landing-form-header {
    display: none !important;
}

/* Grid Layout for Fields */
.landing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 2rem;
    margin-bottom: 1.75rem;
}

.landing-grid .field-group {
    margin-bottom: 0 !important;
}

@media (max-width: 640px) {
    .landing-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* Field labels and inputs styling overrides for light landing mode */
body:has(.view-landing) .form-label,
body.landing-mode .form-label {
    color: #334155 !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    font-size: 1rem !important;
}

body:has(.view-landing) .form-input,
body.landing-mode .form-input {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.85rem 1.25rem 0.85rem 2.75rem !important;
    font-size: 1.05rem !important;
    border-radius: 0.6rem !important;
}

body:has(.view-landing) .form-input:hover,
body.landing-mode .form-input:hover {
    border-color: #94a3b8 !important;
}

body:has(.view-landing) .form-input:focus,
body.landing-mode .form-input:focus {
    border-color: #8c9cb2 !important;
    box-shadow: 0 0 0 3px rgba(140, 156, 178, 0.2) !important;
}

body:has(.view-landing) .input-icon,
body.landing-mode .input-icon {
    color: #64748b !important;
    left: 1rem !important;
    width: 1.1rem !important;
    height: 1.1rem !important;
}

/* Consent Checkbox Styling */
.consent-group {
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    font-size: 1rem;
    color: #475569;
    cursor: pointer;
    line-height: 1.4;
    user-select: none;
}

.consent-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-checkbox {
    width: 1.3rem;
    height: 1.3rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.3rem;
    background-color: #ffffff;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.1rem;
    transition: all 0.2s ease;
}

.consent-label:hover .custom-checkbox {
    border-color: #8c9cb2;
}

.consent-label input[type="checkbox"]:checked ~ .custom-checkbox {
    background-color: #8c9cb2;
    border-color: #8c9cb2;
}

.consent-label input[type="checkbox"]:checked ~ .custom-checkbox::after {
    content: "";
    position: absolute;
    left: 0.4rem;
    top: 0.2rem;
    width: 0.35rem;
    height: 0.55rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.consent-text {
    font-weight: 500;
}

/* Landing button styling overrides */
body:has(.view-landing) .btn-begin-app,
body.landing-mode .btn-begin-app {
    background: #8c9cb2 !important; /* Muted blue-grey button matching template */
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(140, 156, 178, 0.2) !important;
    padding: 1.1rem 2.25rem !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    border-radius: 0.6rem !important;
    transition: all 0.2s ease !important;
}

body:has(.view-landing) .btn-begin-app:hover,
body.landing-mode .btn-begin-app:hover {
    background: #7a8a9e !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(140, 156, 178, 0.3) !important;
}

body:has(.view-landing) .btn-begin-app:active,
body.landing-mode .btn-begin-app:active {
    transform: translateY(0) !important;
}

body:has(.view-landing) .landing-action-wrapper,
body.landing-mode .landing-action-wrapper {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

/* Scrollability Fix for Portal Mode on Desktop */
@media (min-width: 993px) {
    body {
        min-height: 100vh;
        overflow-y: auto !important; /* Enable standard scroll */
        height: auto !important;
        display: flex;
        flex-direction: column;
    }
    
    .app-layout {
        height: auto !important;
        min-height: calc(100vh - 140px) !important;
    }
    
    .app-layout.view-portal .sidebar {
        height: fit-content !important;
        position: sticky !important;
        top: 95px !important;
    }
    
    .app-layout.view-portal .form-column {
        height: auto !important;
    }
    
    .form-card {
        max-height: none !important;
        display: block !important;
        overflow: visible !important;
    }
    
    #startup-form {
        overflow-y: visible !important;
        padding-right: 0 !important;
    }
}

/* ==========================================
   Portal Page Theme Alignment (Steps 2-6)
   ========================================== */

/* 1. Page Background & Scrollability */
body:has(.view-portal),
body.portal-mode {
    --bg-color: #eae9f2 !important;
    background-color: #eae9f2 !important;
    color: #1e293b !important;
}

body:has(.view-portal)::before,
body.portal-mode::before,
body:has(.view-portal) .bg-glow,
body.portal-mode .bg-glow {
    display: none !important;
}

/* 2. Top Navigation Bar */
body:has(.view-portal) .navbar,
body.portal-mode .navbar {
    background-color: rgba(234, 233, 242, 0.85) !important;
    border-bottom: 1px solid #cbd5e1 !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}
body:has(.view-portal) .brand-logo,
body.portal-mode .brand-logo {
    mix-blend-mode: multiply !important;
}
body:has(.view-portal) .close-date,
body.portal-mode .close-date {
    color: #475569 !important;
}
body:has(.view-portal) .bold-date,
body.portal-mode .bold-date {
    color: #1e1b4b !important;
}
body:has(.view-portal) .status-badge,
body.portal-mode .status-badge {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

/* 3. Sidebar Container (Removed Card Wrapper) */
body:has(.view-portal) .sidebar,
body.portal-mode .sidebar {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
body:has(.view-portal) .progress-title,
body.portal-mode .progress-title {
    color: #64748b !important;
}
body:has(.view-portal) .progress-percentage,
body.portal-mode .progress-percentage {
    color: #0f172a !important;
}
body:has(.view-portal) .progress-bar-wrapper,
body.portal-mode .progress-bar-wrapper {
    background-color: #e2e8f0 !important;
}
body:has(.view-portal) .progress-bar-fill,
body.portal-mode .progress-bar-fill {
    background: #8c9cb2 !important;
}

/* 4. Sidebar Step Items */
body:has(.view-portal) .step-nav-icon,
body.portal-mode .step-nav-icon {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #64748b !important;
}
body:has(.view-portal) .step-nav-title,
body.portal-mode .step-nav-title {
    color: #475569 !important;
}
body:has(.view-portal) .step-nav-subtitle,
body.portal-mode .step-nav-subtitle {
    color: #64748b !important;
}

/* 5. Active and Completed Step Styling (with card wrapper removed) */
body:has(.view-portal) .step-nav-item,
body.portal-mode .step-nav-item {
    border: 1px solid transparent !important;
    margin-bottom: 0.25rem !important;
}
body:has(.view-portal) .step-nav-item.active,
body.portal-mode .step-nav-item.active {
    background-color: rgba(255, 255, 255, 0.6) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
}
body:has(.view-portal) .step-nav-item.active .step-nav-icon,
body.portal-mode .step-nav-item.active .step-nav-icon {
    background-color: #8c9cb2 !important;
    border-color: #8c9cb2 !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(140, 156, 178, 0.3) !important;
}
body:has(.view-portal) .step-nav-item.active .step-nav-title,
body.portal-mode .step-nav-item.active .step-nav-title {
    color: #0f172a !important;
}
body:has(.view-portal) .step-nav-item.completed .step-nav-icon,
body.portal-mode .step-nav-item.completed .step-nav-icon {
    background-color: #d1fae5 !important;
    border-color: #a7f3d0 !important;
    color: #10b981 !important;
}
body:has(.view-portal) .step-nav-item.completed .step-nav-title,
body.portal-mode .step-nav-item.completed .step-nav-title {
    color: #334155 !important;
}

/* 6. Selection Tip Box */
body:has(.view-portal) .tip-card,
body.portal-mode .tip-card {
    background-color: #fffbeb !important;
    border: 1px solid #fde68a !important;
    border-radius: 0.5rem !important;
}
body:has(.view-portal) .tip-header,
body.portal-mode .tip-header {
    color: #d97706 !important;
}
body:has(.view-portal) .tip-text,
body.portal-mode .tip-text {
    color: #78350f !important;
}

/* 7. Form Container (Card Style Removal) */
body:has(.view-portal) .form-card,
body.portal-mode .form-card {
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    max-height: none !important;
    height: auto !important;
    display: block !important;
    overflow: visible !important;
}

/* 8. Portal Step Title Headers */
body:has(.view-portal) .step-title-portal,
body.portal-mode .step-title-portal {
    border-bottom: 1px solid #cbd5e1 !important;
    padding-bottom: 1.25rem !important;
    margin-bottom: 2.25rem !important;
}
body:has(.view-portal) .step-title-portal h3,
body.portal-mode .step-title-portal h3 {
    color: #1e1b4b !important;
    font-size: 1.45rem !important;
    font-weight: 800 !important;
}
body:has(.view-portal) .step-title-portal p,
body.portal-mode .step-title-portal p {
    color: #475569 !important;
}

/* 9. Field Group Input Overrides */
body:has(.view-portal) .form-label,
body.portal-mode .form-label {
    color: #334155 !important;
    font-weight: 600 !important;
}
body:has(.view-portal) .form-input,
body:has(.view-portal) .form-select,
body.portal-mode .form-input,
body.portal-mode .form-select {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.75rem 1rem 0.75rem 2.5rem !important;
    font-size: 0.9rem !important;
    border-radius: 0.5rem !important;
}
body:has(.view-portal) .form-textarea,
body.portal-mode .form-textarea {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 0.9rem 1.15rem !important;
    font-size: 0.9rem !important;
    border-radius: 0.5rem !important;
}
body:has(.view-portal) .input-icon,
body.portal-mode .input-icon {
    color: #64748b !important;
    left: 0.95rem !important;
}

/* Hover and Focus States */
body:has(.view-portal) .form-input:hover,
body:has(.view-portal) .form-select:hover,
body:has(.view-portal) .form-textarea:hover,
body.portal-mode .form-input:hover,
body.portal-mode .form-select:hover,
body.portal-mode .form-textarea:hover {
    border-color: #94a3b8 !important;
}
body:has(.view-portal) .form-input:focus,
body:has(.view-portal) .form-select:focus,
body:has(.view-portal) .form-textarea:focus,
body.portal-mode .form-input:focus,
body.portal-mode .form-select:focus,
body.portal-mode .form-textarea:focus {
    border-color: #8c9cb2 !important;
    box-shadow: 0 0 0 3px rgba(140, 156, 178, 0.2) !important;
}
body:has(.view-portal) .form-input:focus + .input-icon,
body:has(.view-portal) .form-select:focus + .input-icon,
body.portal-mode .form-input:focus + .input-icon,
body.portal-mode .form-select:focus + .input-icon {
    color: #8c9cb2 !important;
}

/* Dropdown Arrow Overrides */
body:has(.view-portal) .input-wrapper:has(.form-select)::after,
body.portal-mode .input-wrapper:has(.form-select)::after {
    border-top-color: #64748b !important;
}
body:has(.view-portal) .input-wrapper:has(.form-select:focus)::after,
body.portal-mode .input-wrapper:has(.form-select:focus)::after {
    border-top-color: #8c9cb2 !important;
}

/* 10. Custom Radio Toggles */
body:has(.view-portal) .radio-label,
body.portal-mode .radio-label {
    color: #475569 !important;
}
body:has(.view-portal) .radio-label input:checked ~ span,
body.portal-mode .radio-label input:checked ~ span {
    color: #0f172a !important;
}
body:has(.view-portal) .custom-radio,
body.portal-mode .custom-radio {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}
body:has(.view-portal) .radio-label:hover .custom-radio,
body.portal-mode .radio-label:hover .custom-radio {
    border-color: #94a3b8 !important;
}
body:has(.view-portal) .radio-label input:checked ~ .custom-radio,
body.portal-mode .radio-label input:checked ~ .custom-radio {
    border-color: #8c9cb2 !important;
    background-color: rgba(140, 156, 178, 0.1) !important;
}
body:has(.view-portal) .radio-label input:checked ~ .custom-radio::after,
body.portal-mode .radio-label input:checked ~ .custom-radio::after {
    background-color: #8c9cb2 !important;
}

/* 11. Character Counter & Status Indicators */
body:has(.view-portal) .char-counter,
body.portal-mode .char-counter {
    color: #64748b !important;
}
body:has(.view-portal) .autosave-indicator,
body.portal-mode .autosave-indicator {
    color: #64748b !important;
}

/* 12. Navigation Buttons & Action Bar */
body:has(.view-portal) .portal-action-bar,
body.portal-mode .portal-action-bar {
    border-top: 1px solid #cbd5e1 !important;
    margin-top: 3rem !important;
    padding-top: 1.75rem !important;
}
body:has(.view-portal) .btn-secondary,
body.portal-mode .btn-secondary {
    background-color: #ffffff !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
}
body:has(.view-portal) .btn-secondary:hover,
body.portal-mode .btn-secondary:hover {
    background-color: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}
body:has(.view-portal) .btn-primary-premium,
body.portal-mode .btn-primary-premium {
    background: #8c9cb2 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(140, 156, 178, 0.2) !important;
}
body:has(.view-portal) .btn-primary-premium:hover,
body.portal-mode .btn-primary-premium:hover {
    background: #7a8a9e !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(140, 156, 178, 0.35) !important;
}
body:has(.view-portal) .btn-primary-premium:active,
body.portal-mode .btn-primary-premium:active {
    transform: translateY(0) !important;
}

/* 13. File Upload Drop Zones & Tabs */
body:has(.view-portal) .upload-tabs,
body.portal-mode .upload-tabs {
    background-color: #e2e8f0 !important;
    border: 1px solid #cbd5e1 !important;
}
body:has(.view-portal) .upload-tab,
body.portal-mode .upload-tab {
    color: #475569 !important;
}
body:has(.view-portal) .upload-tab.active,
body.portal-mode .upload-tab.active {
    background-color: #8c9cb2 !important;
    color: #ffffff !important;
}
body:has(.view-portal) .file-upload-zone,
body.portal-mode .file-upload-zone {
    border: 2px dashed #cbd5e1 !important;
    background-color: rgba(255, 255, 255, 0.5) !important;
}
body:has(.view-portal) .file-upload-zone:hover,
body:has(.view-portal) .file-upload-zone.dragover,
body.portal-mode .file-upload-zone:hover,
body.portal-mode .file-upload-zone.dragover {
    border-color: #8c9cb2 !important;
    background-color: rgba(140, 156, 178, 0.04) !important;
}
body:has(.view-portal) .upload-icon,
body.portal-mode .upload-icon {
    color: #64748b !important;
}
body:has(.view-portal) .file-upload-zone:hover .upload-icon,
body.portal-mode .file-upload-zone:hover .upload-icon {
    color: #8c9cb2 !important;
}
body:has(.view-portal) .upload-text-main,
body.portal-mode .upload-text-main {
    color: #0f172a !important;
}
body:has(.view-portal) .upload-text-sub,
body.portal-mode .upload-text-sub {
    color: #64748b !important;
}
body:has(.view-portal) .btn-browse,
body.portal-mode .btn-browse {
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
body:has(.view-portal) .file-selected-info,
body.portal-mode .file-selected-info {
    background-color: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
}
body:has(.view-portal) .selected-file-name,
body.portal-mode .selected-file-name {
    color: #065f46 !important;
}
body:has(.view-portal) .selected-file-size,
body.portal-mode .selected-file-size {
    color: #047857 !important;
}
body:has(.view-portal) .btn-remove-file,
body.portal-mode .btn-remove-file {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #4b5563 !important;
}
body:has(.view-portal) .btn-remove-file:hover,
body.portal-mode .btn-remove-file:hover {
    background-color: #fee2e2 !important;
    color: #ef4444 !important;
}

/* 14. Modals & Dialogs */
body:has(.view-portal) .modal-backdrop,
body.portal-mode .modal-backdrop {
    background-color: rgba(15, 23, 42, 0.4) !important;
}
body:has(.view-portal) .modal-content,
body.portal-mode .modal-content {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}
body:has(.view-portal) .modal-content h2,
body.portal-mode .modal-content h2 {
    color: #0f172a !important;
}
body:has(.view-portal) .modal-content p,
body.portal-mode .modal-content p {
    color: #334155 !important;
}
body:has(.view-portal) .reference-box,
body.portal-mode .reference-box {
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}
body:has(.view-portal) .ref-label,
body.portal-mode .ref-label {
    color: #64748b !important;
}
body:has(.view-portal) .ref-id,
body.portal-mode .ref-id {
    color: #0f172a !important;
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}
body:has(.view-portal) .btn-copy-ref,
body.portal-mode .btn-copy-ref {
    color: #8c9cb2 !important;
}
body:has(.view-portal) .btn-copy-ref:hover,
body.portal-mode .btn-copy-ref:hover {
    color: #7a8a9e !important;
}
body:has(.view-portal) .modal-subtext,
body.portal-mode .modal-subtext {
    color: #64748b !important;
}
body:has(.view-portal) .btn-modal-close,
body.portal-mode .btn-modal-close {
    background: #8c9cb2 !important;
}

/* 15. Toast Notifications */
body:has(.view-portal) .toast,
body.portal-mode .toast {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}
body:has(.view-portal) .toast-spinner,
body.portal-mode .toast-spinner {
    border-top-color: #8c9cb2 !important;
    border-left-color: rgba(0,0,0,0.1) !important;
    border-right-color: rgba(0,0,0,0.1) !important;
    border-bottom-color: rgba(0,0,0,0.1) !important;
}

/* 16. Footer Overrides */
body:has(.view-portal) .footer,
body.portal-mode .footer {
    color: #64748b !important;
    border-top: 1px solid #cbd5e1 !important;
}


