/* ============================================================================
   Application Form Custom Styles
   Enhanced UI for ULAB Online Admission Module
   ============================================================================ */

/* ====================
   Form Validation States
   ==================== */

/* Error state for required fields (matching PHP .needsfilled class) */
.needsfilled,
.mud-input-error,
.mud-select-error {
    border-color: var(--mud-palette-error) !important;
    animation: shake 0.3s ease-in-out, pulseError 2s ease-in-out infinite;
}

    .needsfilled .mud-input-slot,
    .needsfilled .mud-select-input {
        border-color: var(--mud-palette-error) !important;
        box-shadow: 0 0 0 2px rgba(var(--mud-palette-error-rgb), 0.2);
    }

        .needsfilled:focus-within,
        .needsfilled .mud-input-slot:focus-within {
            box-shadow: 0 0 0 3px rgba(var(--mud-palette-error-rgb), 0.3);
        }

/* Valid/Complete state */
.field-valid,
.field-complete {
    border-color: var(--mud-palette-success) !important;
}

    .field-valid .mud-input-slot,
    .field-complete .mud-input-slot {
        border-left: 3px solid var(--mud-palette-success);
    }

/* Touched but incomplete */
.field-touched {
    border-color: var(--mud-palette-warning) !important;
}

/* ====================
   Animations
   ==================== */

/* Shake animation for validation errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(4px);
    }
}

/* Pulse animation for error fields */
@keyframes pulseError {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--mud-palette-error-rgb), 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(var(--mud-palette-error-rgb), 0);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide down animation */
@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 1;
        max-height: 1000px;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
}

/* Bounce in animation for success states */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

/* Gentle pulse for loading states */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ====================
   Form Layout & Structure
   ==================== */

/* Tab content transitions */
.mud-tabs-panels {
    animation: fadeIn 0.4s ease-in-out;
}

.tab-pane {
    animation: fadeIn 0.3s ease-in-out;
}

/* Form card styling */
.form-card {
    border-radius: 12px;
    transition: all 0.3s ease;
}

    .form-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
    }

/* Section headers */
.form-section-header {
    border-left: 4px solid var(--mud-palette-primary);
    padding-left: 12px;
    margin-bottom: 16px;
}

/* ====================
   Progress Indicators
   ==================== */

/* Tab completion badges */
.tab-badge-complete {
    background-color: var(--mud-palette-success);
    color: white;
    animation: bounceIn 0.5s ease-in-out;
}

.tab-badge-incomplete {
    background-color: var(--mud-palette-grey-400);
    color: var(--mud-palette-text-secondary);
}

.tab-badge-error {
    background-color: var(--mud-palette-error);
    color: white;
    animation: pulseError 2s ease-in-out infinite;
}

/* Progress bar enhancements */
.progress-bar-animated .mud-progress-linear {
    animation: pulse 2s ease-in-out infinite;
}

.progress-bar-animated .mud-progress-linear-bar {
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================
   Photo Upload Component
   ==================== */

.photo-upload-container {
    position: relative;
    overflow: hidden;
}

.photo-preview-frame {
    border: 2px dashed var(--mud-palette-divider);
    border-radius: 12px;
    padding: 12px;
    background: var(--mud-palette-background-grey);
    transition: all 0.3s ease;
}

    .photo-preview-frame:hover {
        border-color: var(--mud-palette-primary);
        border-style: solid;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .photo-preview-frame.has-photo {
        border-color: var(--mud-palette-success);
        border-style: solid;
    }

.photo-preview-image {
    border-radius: 8px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

    .photo-preview-image:hover {
        transform: scale(1.02);
    }

.photo-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ====================
   Exam Entry Cards
   ==================== */

.exam-card {
    border-radius: 8px;
    border-left: 4px solid var(--mud-palette-divider);
    transition: all 0.3s ease;
    animation: fadeIn 0.4s ease-in-out;
}

    .exam-card:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
        transform: translateX(4px);
    }

.exam-card-required {
    border-left-color: var(--mud-palette-primary);
    background: linear-gradient(to right, rgba(var(--mud-palette-primary-rgb), 0.02), transparent);
}

.exam-card-complete {
    border-left-color: var(--mud-palette-success);
}

.exam-card-error {
    border-left-color: var(--mud-palette-error);
    background: rgba(var(--mud-palette-error-rgb), 0.02);
    animation: shake 0.3s ease-in-out;
}

.exam-card-header {
    border-bottom: 1px solid var(--mud-palette-divider);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

/* ====================
   Auto-Save Indicator
   ==================== */

.autosave-indicator {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 1200;
    padding: 8px 16px;
    background: var(--mud-palette-background);
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

    .autosave-indicator.saving {
        border: 2px solid var(--mud-palette-primary);
    }

    .autosave-indicator.saved {
        border: 2px solid var(--mud-palette-success);
        animation: bounceIn 0.5s ease-in-out;
    }

    .autosave-indicator.error {
        border: 2px solid var(--mud-palette-error);
        animation: shake 0.3s ease-in-out;
    }

/* ====================
   Validation Summary Panel
   ==================== */

.validation-summary-panel {
    border-left: 4px solid var(--mud-palette-error);
    animation: slideDown 0.4s ease-out;
}

    .validation-summary-panel .mud-expand-panel {
        background: linear-gradient(to right, rgba(var(--mud-palette-error-rgb), 0.03), transparent);
    }

.validation-error-item {
    padding: 4px 0;
    border-left: 2px solid var(--mud-palette-error);
    padding-left: 12px;
    margin-bottom: 4px;
}

.validation-warning-item {
    padding: 4px 0;
    border-left: 2px solid var(--mud-palette-warning);
    padding-left: 12px;
    margin-bottom: 4px;
}

/* ====================
   Responsive Design
   ==================== */

/* Mobile adjustments */
@media (max-width: 960px) {
    .form-card {
        border-radius: 8px;
    }

    .exam-card {
        margin-bottom: 12px;
    }

    .autosave-indicator {
        top: auto;
        bottom: 80px;
        right: 16px;
        font-size: 0.85rem;
    }

    /* Larger touch targets */
    .mud-button {
        min-height: 48px;
    }

    .mud-input,
    .mud-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Stack form elements vertically on small screens */
    .mud-grid-item {
        padding: 8px !important;
    }
}

@media (max-width: 600px) {
    .photo-preview-frame {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .tab-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    /* Hide less critical elements on very small screens */
    .form-helper-text {
        font-size: 0.75rem;
    }
}

/* Landscape mobile */
@media (max-width: 960px) and (orientation: landscape) {
    .autosave-indicator {
        top: 12px;
        right: 12px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* ====================
   Accessibility Enhancements
   ==================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .needsfilled {
        border-width: 3px !important;
    }

    .exam-card {
        border-left-width: 6px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
.mud-button:focus-visible,
.mud-input:focus-visible,
.mud-select:focus-visible {
    outline: 3px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

/* ====================
   Print Styles
   ==================== */

@media print {
    .autosave-indicator,
    .mud-appbar,
    .form-navigation-buttons,
    .photo-upload-button {
        display: none !important;
    }

    .form-card,
    .exam-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--theme-text-primary);
    }

    .needsfilled {
        border: 2px solid var(--theme-text-primary) !important;
    }
}

/* ====================
   Loading States
   ==================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* keep neutral overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-in-out;
}

.loading-spinner {
    animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-loading {
    background: linear-gradient( 90deg, var(--mud-palette-background-grey) 0%, var(--mud-palette-background) 50%, var(--mud-palette-background-grey) 100% );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ====================
   Utility Classes
   ==================== */

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

.bounce-in {
    animation: bounceIn 0.5s ease-in-out;
}

.shake {
    animation: shake 0.3s ease-in-out;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Smooth transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shadow elevations */
.elevation-hover:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Text truncation */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ====================
   Dark Mode Support
   ==================== */

@media (prefers-color-scheme: dark) {
    .photo-preview-frame {
        background: rgba(255, 255, 255, 0.05);
    }

    .form-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    }

    .needsfilled {
        box-shadow: 0 0 0 2px rgba(var(--mud-palette-error-rgb), 0.4);
    }
}

/* =============================================================================
   Career portal resource cards (JobList grid + Application Form sidebar, Figma)
   ============================================================================= */

.need-assistance-figma-section {
    border: none;
    overflow: hidden;
    background: var(--theme-career-resource-section-bg, var(--theme-background));
}

.career-portal-resource-cards-grid-container {
    padding-top: var(--theme-career-resource-section-padding-y, 60px) !important;
    padding-bottom: var(--theme-career-resource-section-padding-y, 60px) !important;
}

.career-portal-resource-cards--grid .career-portal-resource-card {
    height: 100%;
}

.career-portal-resource-cards--grid .career-portal-resource-card-inner {
    position: relative;
    min-height: var(--theme-app-form-resource-grid-min-height, 450px);
    border-radius: var(--theme-app-form-resource-card-radius, 10px);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.career-portal-resource-cards--sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--theme-app-form-sidebar-cards-gap, 30px);
    position: sticky;
    top: 88px;
    align-self: flex-start;
    width: 100%;
}

    /* Application form sidebar (Figma 214:5940): flow layout so card height follows content */
    .career-portal-resource-cards--sidebar .career-portal-resource-card-inner {
        position: relative;
        display: flex;
        flex-direction: column;
        border-radius: var(--theme-app-form-resource-card-radius, 10px);
        overflow: hidden;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .career-portal-resource-cards--sidebar .career-portal-resource-card-overlay {
        position: relative;
        inset: auto;
        flex: 1 1 auto;
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
        gap: var(--theme-app-form-sidebar-card-stack-gap, 30px);
    }

.career-portal-resource-cards--sidebar .career-portal-resource-card--faq .career-portal-resource-card-overlay {
    padding: 30px;
}

.career-portal-resource-cards--sidebar .career-portal-resource-card--need-help .career-portal-resource-card-overlay,
.career-portal-resource-cards--sidebar .career-portal-resource-card--guidelines .career-portal-resource-card-overlay,
.career-portal-resource-cards--sidebar .career-portal-resource-card--join .career-portal-resource-card-overlay {
    padding: 40px;
}

/* Sidebar typography — Figma: title 28px semibold, body 20px medium */
.career-portal-resource-cards--sidebar .career-portal-resource-card-title {
    font-size: var(--theme-app-form-sidebar-resource-title-size, 1.75rem) !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    max-width: 300px;
}

.career-portal-resource-cards--sidebar .career-portal-resource-card--faq .career-portal-resource-card-title {
    max-width: 320px;
}

.career-portal-resource-cards--sidebar .career-portal-resource-card-desc {
    font-size: var(--theme-app-form-sidebar-resource-body-size, 1.25rem) !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    max-width: 300px;
}

.career-portal-resource-cards--sidebar .career-portal-resource-card--faq .career-portal-resource-card-desc {
    max-width: 320px;
}

/* Sidebar CTAs — fixed widths per Figma */
.career-portal-resource-cards--sidebar .career-portal-resource-card-cta--sidebar-faq {
    width: 152px !important;
    min-width: 152px !important;
    max-width: 152px !important;
    min-height: 52px !important;
    height: 52px !important;
    padding: 5px 15px !important;
    align-self: center;
}

.career-portal-resource-cards--sidebar .career-portal-resource-card-cta--sidebar-guidelines {
    width: 210px !important;
    min-width: 210px !important;
    max-width: 210px !important;
    min-height: 52px !important;
    height: 52px !important;
    padding: 5px 15px !important;
    align-self: center;
}

/* Guidelines Join card — Figma 446:119 (sidebar promo) */
.career-portal-resource-cards--sidebar .career-portal-resource-card-cta--sidebar-join {
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    min-height: 52px !important;
    height: 52px !important;
    padding: 5px 15px !important;
    align-self: center;
}

/* Resource card CTAs (sidebar + job list grid) */
.career-portal-resource-cards--sidebar .career-portal-resource-card-cta .mud-button-label,
.career-portal-resource-cards--grid .career-portal-resource-card-cta .mud-button-label {
    font-size: 1rem !important;
    font-weight: 500 !important;
}

.career-portal-resource-card-contact-stack--sidebar {
    gap: 10px !important;
}

.career-portal-resource-cards--sidebar .career-portal-resource-contact-box--sidebar {
    padding: 10px !important;
    gap: 10px;
}

    .career-portal-resource-cards--sidebar .career-portal-resource-contact-box--sidebar .mud-typography,
    .career-portal-resource-cards--sidebar .career-portal-resource-contact-box--sidebar .career-portal-resource-contact-link {
        font-size: var(--theme-app-form-sidebar-contact-text-size, 1.125rem) !important;
        font-weight: 500 !important;
        line-height: 1.56 !important;
    }

    .career-portal-resource-cards--sidebar .career-portal-resource-contact-box--sidebar .mud-icon-root {
        font-size: 1.5rem !important;
        width: 1.5rem !important;
        height: 1.5rem !important;
    }

.career-portal-resource-cards--sidebar .career-portal-resource-contact-box--sidebar .career-portal-resource-contact-link {
    text-decoration: underline;
}

    .career-portal-resource-cards--sidebar .career-portal-resource-contact-box--sidebar .career-portal-resource-contact-link:hover {
        text-decoration: underline;
    }

.career-portal-resource-card-overlay {
    position: absolute;
    inset: 0;
    background: var(--theme-card-overlay);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.career-portal-resource-card-title {
    color: var(--theme-surface) !important;
    font-weight: 700 !important;
    font-size: var(--theme-app-form-resource-card-title-size, 1.75rem) !important;
    line-height: 1.3 !important;
}

.career-portal-resource-card-desc {
    color: color-mix(in srgb, var(--theme-surface) 95%, transparent) !important;
    font-size: var(--theme-app-form-resource-card-body-size, 1.25rem) !important;
    line-height: 1.4 !important;
    max-width: 320px;
}

.career-portal-resource-card-cta {
    background-color: var(--theme-accent) !important;
    color: var(--theme-resource-card-button-color) !important;
    text-transform: none !important;
    border-radius: var(--theme-app-form-resource-cta-radius, 10px) !important;
    border: 1px solid var(--theme-surface) !important;
    min-height: 52px;
}

    .career-portal-resource-card-cta:hover {
        background-color: var(--theme-accent-hover) !important;
    }

.career-portal-resource-card-contact-stack {
    width: 100%;
}

.career-portal-resource-contact-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--theme-surface);
    color: var(--theme-body-text);
    padding: 10px 16px;
    border-radius: var(--theme-app-form-resource-cta-radius, 10px);
    width: 100%;
    border: 1px solid var(--theme-surface);
}

    .career-portal-resource-contact-box .mud-icon-root {
        color: var(--theme-body-text) !important;
    }

    .career-portal-resource-contact-box .mud-typography {
        color: var(--theme-body-text) !important;
        font-weight: 500 !important;
    }

.career-portal-resource-contact-link {
    color: var(--theme-body-text) !important;
    font-weight: 500;
    text-decoration: underline;
}

.career-portal-resource-cards--grid .career-portal-resource-card-overlay {
    padding: 40px;
    gap: 0;
    justify-content: space-between;
}

.career-portal-resource-cards--grid .career-portal-resource-card-title {
    font-size: var(--theme-career-resource-grid-title-size, 2rem) !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    max-width: 360px;
}

.career-portal-resource-cards--grid .career-portal-resource-card-desc {
    font-size: var(--theme-career-resource-grid-desc-size, 16px) !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    max-width: 281px;
}

/* Figma: primary CTA ~282px wide, centered; FAQ CTA intrinsic width ~176px */
.career-portal-resource-cards--grid .career-portal-resource-card-cta--grid-primary {
    width: 100%;
    max-width: 282px;
    align-self: center;
}

.career-portal-resource-cards--grid .career-portal-resource-card-cta--grid-faq {
    width: auto;
    min-width: 176px;
    align-self: center;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.career-portal-resource-cards--grid .career-portal-resource-contact-box {
    font-size: var(--theme-career-resource-grid-contact-size, 1.375rem);
    padding: 10px 20px;
}

    .career-portal-resource-cards--grid .career-portal-resource-contact-box .mud-typography,
    .career-portal-resource-cards--grid .career-portal-resource-contact-link {
        font-size: var(--theme-app-form-sidebar-contact-text-size, 1.125rem) !important;
        line-height: 1.27 !important;
    }

    .career-portal-resource-cards--grid .career-portal-resource-contact-link {
        text-decoration: none;
    }

        .career-portal-resource-cards--grid .career-portal-resource-contact-link:hover {
            text-decoration: underline;
        }

/* Application form tab: main + sidebar (Figma ~990px + gap + flexible rail) */
.app-form-tab-figma-grid {
    align-items: flex-start;
    gap: var(--theme-app-form-tab-column-gap, 30px) !important;
}

.app-form-tab-main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 990px;
}

.app-form-tab-sidebar {
    flex: 1 1 280px;
    min-width: 0;
    max-width: 420px;
}

.app-form-section-title {
    border-bottom: 1px solid var(--theme-primary);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

    .app-form-section-title .mud-typography {
        color: var(--theme-primary) !important;
        font-weight: 600 !important;
    }

/* Profile / Research: Figma download | upload split row — equal column heights */
.app-form-template-row {
    align-items: stretch !important;
}

    .app-form-template-row > .mud-grid-item {
        display: flex;
        flex-direction: column;
        align-self: stretch;
    }

        .app-form-template-row > .mud-grid-item > .mud-paper {
            flex: 1 1 auto;
            width: 100%;
            min-height: var(--theme-app-form-file-row-min-height, 88px);
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
        }

    /* Template + CV shared 64px row (Profile Summary / Research) */
    .app-form-template-row.app-form-cv-figma-row > .mud-grid-item > .mud-paper.app-form-cv-file-panel {
        min-height: 64px !important;
        max-height: 64px !important;
        height: 64px !important;
    }

    .app-form-template-row .app-form-template-download-panel {
        border: 1px solid var(--theme-primary);
        border-radius: 8px;
    }

        .app-form-template-row .app-form-template-download-panel > .mud-stack {
            flex: 1 1 auto;
            min-height: 0;
            align-self: stretch;
        }

        .app-form-template-row .app-form-template-download-panel > .mud-alert,
        .app-form-template-row .app-form-template-download-panel > .mud-typography {
            flex: 1 1 auto;
            display: flex;
            align-items: center;
        }

    .app-form-template-row .app-form-template-upload-panel {
        background: var(--theme-success);
        color: var(--theme-surface);
        border-radius: 8px;
    }

        .app-form-template-row .app-form-template-upload-panel .mud-stack {
            flex: 1 1 auto;
            min-height: 0 !important;
            align-self: stretch;
            justify-content: center;
        }

        .app-form-template-row .app-form-template-upload-panel .mud-typography,
        .app-form-template-row .app-form-template-upload-panel .mud-icon-root {
            color: var(--theme-surface) !important;
        }

        .app-form-template-row .app-form-template-upload-panel .mud-button-filled,
        .app-form-template-row .app-form-template-upload-btn {
            background-color: color-mix(in srgb, var(--theme-surface) 22%, transparent) !important;
            color: var(--theme-surface) !important;
        }

.app-form-template-download-btn {
    min-height: 40px;
    text-transform: none;
    font-weight: 600;
}

.app-form-template-upload-hint {
    color: var(--theme-surface) !important;
    text-align: center;
}

/* Personal details: CV row — Figma node 224:264 (GrameenU Career Portal) */
.app-form-cv-heading-title {
    font-weight: 500 !important;
    letter-spacing: 0.015em;
}

.app-form-cv-heading-required {
    color: var(--theme-error) !important;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.75rem;
}

.app-form-cv-file-panel {
    border: 1px solid var(--theme-divider);
    border-radius: 8px;
    background: var(--theme-surface);
    box-sizing: border-box;
    min-height: 64px;
    max-height: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    padding: 10px 11px;
    overflow: hidden;
}

    .app-form-cv-file-panel > * {
        width: 100%;
        min-width: 0;
    }

.app-form-cv-file-name,
.app-form-cv-file-size {
    color: color-mix(in srgb, var(--theme-body-text) 72%, transparent) !important;
}

.app-form-cv-file-name {
    font-weight: 600 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-form-cv-empty-text {
    color: color-mix(in srgb, var(--theme-body-text) 68%, transparent) !important;
}

.app-form-cv-file-info {
    min-width: 0;
    flex: 1 1 auto;
}

.app-form-cv-pdf-icon {
    font-size: 28px !important;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.app-form-cv-pdf-icon--excel {
    color: var(--theme-app-form-file-icon-excel) !important;
}

.app-form-cv-pdf-icon--word {
    color: var(--theme-app-form-file-icon-word) !important;
}

.app-form-cv-pdf-icon--pdf {
    color: var(--theme-app-form-file-icon-pdf) !important;
}

.app-form-cv-action-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    padding: 0 !important;
    border-radius: 5px !important;
}

.app-form-cv-upload-bar-label {
    display: block;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.app-form-cv-upload-bar-label--disabled {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.88;
}

.app-form-cv-upload-bar {
    background: var(--theme-success) !important;
    border-radius: 8px;
    min-height: 64px;
    max-height: 64px;
    height: 64px;
    width: 100%;
    overflow: hidden;
}

    .app-form-cv-upload-bar.mud-paper {
        background: var(--theme-success) !important;
        max-height: 64px !important;
        min-height: 64px;
        height: 64px;
    }

.app-form-cv-upload-bar-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 100%;
    max-height: 64px;
    padding: 0 15px;
    box-sizing: border-box;
}

.app-form-cv-upload-bar-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.app-form-cv-upload-bar-title {
    color: var(--theme-surface) !important;
    font-weight: 700 !important;
    font-size: 0.9375rem !important;
    line-height: 1.2 !important;
}

.app-form-cv-upload-bar-hint {
    color: var(--theme-surface) !important;
    font-weight: 600 !important;
    opacity: 0.98;
    display: block;
    margin-top: 0;
    line-height: 1.2;
    font-size: 0.7rem !important;
}

.app-form-cv-upload-bar-icon-tile {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    background: var(--theme-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .app-form-cv-upload-bar-icon-tile .mud-icon-root {
        color: var(--theme-success) !important;
        font-size: 1.25rem !important;
    }

.app-form-required-asterisk {
    color: var(--theme-error);
}

/* Personal details: MudBlazor Required="true" adds label ::after "*" — match CV row asterisk (error) */
.app-form-figma-personal-details .mud-input-control.mud-input-required > .mud-input-control-input-container > .mud-input-label::after {
    color: var(--theme-error) !important;
}

/* =============================================================================
   Application form page shell (header, stepper, tabs, main + sidebar column)
   ============================================================================= */

.application-form-container .app-form-page-grid {
    align-items: flex-start;
}

.app-form-page-main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 990px;
}

.app-form-page-sidebar {
    flex: 1 1 280px;
    min-width: 0;
    max-width: 420px;
}

.app-form-page-header {
    background: var(--theme-app-form-header-bg);
    border-radius: 0;
    padding: 10px 20px;
    margin-bottom: 0;
}

    .app-form-page-header .app-form-page-header-title {
        color: var(--theme-app-form-header-title-color) !important;
        font-weight: 600 !important;
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
    }

    .app-form-page-header .app-form-page-header-icon {
        color: var(--theme-app-form-header-icon-color) !important;
    }

.app-form-header-submit.mud-button-outlined {
    background-color: var(--theme-app-form-header-submit-bg) !important;
    color: var(--theme-app-form-header-submit-text) !important;
    border: 1px solid var(--theme-app-form-header-submit-border) !important;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.03em;
    min-height: 44px;
}

    .app-form-header-submit.mud-button-outlined:hover {
        background-color: color-mix(in srgb, var(--theme-app-form-header-submit-bg) 92%, var(--theme-app-form-header-submit-text)) !important;
    }

/* Stepper strip (replaces linear progress row) */
.app-form-stepper {
    position: relative;
    background: var(--theme-app-form-stepper-bg);
    border: 1px solid var(--theme-app-form-stepper-border);
    border-radius: 10px;
    padding: 10px 24px 16px;
    margin-bottom: 16px;
}

.app-form-stepper-track {
    position: absolute;
    left: 10%;
    right: 10%;
    top: 30%;
    height: 2px;
    background: var(--theme-app-form-stepper-line);
    pointer-events: none;
}

.app-form-stepper-items {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.app-form-stepper-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    padding: 4px 4px 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    max-width: 140px;
}

    .app-form-stepper-item:focus-visible {
        outline: 2px solid var(--theme-info, var(--theme-primary));
        outline-offset: 2px;
        border-radius: 8px;
    }

.app-form-stepper-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.14);
}

.app-form-stepper-dot--active {
    background: var(--theme-app-form-stepper-active-dot);
    border: none;
}

.app-form-stepper-dot--inactive {
    background: var(--theme-surface);
    border: 1px solid var(--theme-app-form-stepper-inactive-dot-border);
}

.app-form-stepper-label {
    font-size: 1rem;
    line-height: 1.25;
    text-align: center;
    color: var(--theme-app-form-stepper-label-inactive);
    font-weight: 500;
}

.app-form-stepper-item--active .app-form-stepper-label {
    color: var(--theme-app-form-stepper-label-active);
    font-weight: 700;
}

/* MudTabs toolbar + active tab (Figma) */
.app-form-mud-tabs.mud-tabs-rounded {
    border-radius: 0;
}

.app-form-mud-tabs .mud-tabs-toolbar {
    background: var(--theme-app-form-tab-toolbar-bg) !important;
}

.app-form-mud-tabs .mud-tooltip-root {
    width: 230px;
}

.app-form-mud-tabs .mud-tab {
    text-transform: none !important;
    font-weight: 500 !important;
    color: var(--theme-app-form-tab-inactive-fg) !important;
    background: var(--theme-app-form-tab-inactive-bg) !important;
    border-radius: 0 !important;
    min-height: 48px !important;
}

    .app-form-mud-tabs .mud-tab.mud-tab-active {
        background: var(--theme-app-form-tab-active-bg) !important;
        color: var(--theme-app-form-tab-active-fg) !important;
    }

    .app-form-mud-tabs .mud-tab .mud-icon-root {
        color: inherit !important;
    }

.app-form-mud-tabs .mud-tabs-panels {
    background: var(--theme-surface);
}

/* Footer actions: only as wide as main form column */
.app-form-footer-bar {
    border-radius: 8px;
}

/* CV row: left file panel and right upload bar both fixed 64px tall */
.app-form-cv-figma-row {
    align-items: stretch !important;
}

    .app-form-cv-figma-row > .mud-grid-item {
        display: flex;
        flex-direction: column;
    }

        .app-form-cv-figma-row > .mud-grid-item > .app-form-cv-upload-bar-label {
            display: flex;
            flex-direction: column;
            height: 64px;
            min-height: 64px;
            max-height: 64px;
        }

    .app-form-cv-figma-row .app-form-cv-upload-bar.mud-paper {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
    }

    .app-form-cv-figma-row .app-form-cv-upload-bar-inner {
        flex: 1 1 auto;
        align-items: center;
        min-height: 0;
    }

.mud-input > input.mud-input-root, div.mud-input-slot.mud-input-root {
    color: var(--mud-palette-black);
}

@media (max-width: 1279px) {
    .career-portal-resource-cards--sidebar {
        position: static;
    }

    .app-form-tab-sidebar,
    .app-form-page-sidebar {
        max-width: none;
    }

    .app-form-stepper-track {
        display: none;
    }

    .app-form-stepper-items {
        flex-wrap: wrap;
        justify-content: center;
    }
}
