:root {
    --primary: #6B21A8; /* Deep Purple */
    --primary-light: #9333EA;
    --secondary: #F59E0B; /* Golden/Amber */
    --accent: #10B981; /* Emerald for success */
    --bg-color: #F3F4F6;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    
    --biodata-border: #8B5CF6;
    --biodata-bg: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Background Animated Blobs */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-light);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #FCD34D;
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Main Container */
.container {
    width: 100%;
    max-width: 900px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
    z-index: 1;
}

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

.app-header h1 {
    color: var(--primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Progress Bar */
.progress-container {
    position: relative;
    margin-bottom: 3rem;
}

.progress-bar {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 4px;
    background: #E5E7EB;
    width: 100%;
    z-index: -1;
    border-radius: 2px;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary);
    width: 0%; /* Dynamic */
    transition: width 0.4s ease;
    border-radius: 2px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #E5E7EB;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(107, 33, 168, 0.1);
}

.step.completed {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease forwards;
}

.form-step.active {
    display: block;
}

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

.form-step h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(107, 33, 168, 0.1);
    padding-bottom: 0.5rem;
}

/* Input Grid & Fields */
.input-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group.full-width {
    grid-column: span 2;
}

.section-divider {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.section-divider h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    background: rgba(245, 158, 11, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary);
}

label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

input, select, textarea {
    padding: 0.75rem 1rem;
    border: 1px solid #D1D5DB;
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Photo Upload */
.photo-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.upload-area {
    width: 100%;
    max-width: 400px;
    height: 250px;
    border: 2px dashed #D1D5DB;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    text-align: center;
    padding: 2rem;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary);
    background: rgba(107, 33, 168, 0.05);
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.small-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

#image-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#image-preview {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    border: 4px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.hidden {
    display: none !important;
}

/* Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
    border-top: 1px solid #E5E7EB;
    padding-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(107, 33, 168, 0.2);
}

.btn-secondary {
    background: #F3F4F6;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #E5E7EB;
}

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Preview Instruction */
.preview-instruction {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

/* =========================================
   PDF GENERATION THEME (Biodata Preview)
   ========================================= */
.biodata-preview-wrapper {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

.biodata-theme-elegant {
    border: 8px solid var(--primary);
    padding: 2px;
    background: var(--biodata-bg);
    position: relative;
}

/* Inner border */
.biodata-theme-elegant::before {
    content: '';
    display: block;
    border: 2px solid var(--secondary);
    height: 100%;
    width: 100%;
}

.biodata-header {
    text-align: center;
    padding: 2rem 0 1rem;
    position: relative;
}

.om-symbol {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.biodata-header h1 {
    color: var(--primary);
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0;
    border-bottom: 2px solid var(--secondary);
    display: inline-block;
    padding-bottom: 5px;
}

.biodata-body {
    display: flex;
    padding: 2rem;
    gap: 2rem;
}

.biodata-left-col {
    width: 25%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.photo-box {
    width: 160px;
    height: 200px;
    border: 3px solid var(--primary);
    padding: 4px;
    background: white;
}

.photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.biodata-right-col {
    width: 75%;
}

.candidate-name {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    text-transform: capitalize;
}

.details-section {
    margin-bottom: 1.5rem;
}

.details-section h4 {
    font-size: 1.2rem;
    color: white;
    background: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: inline-block;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
}

.details-table td {
    padding: 0.5rem 0;
    font-size: 1.05rem;
    vertical-align: top;
    color: #333;
}

.details-table td:nth-child(1) {
    width: 35%;
    font-weight: 600;
    color: var(--text-main);
}

.details-table td:nth-child(2) {
    width: 5%;
    text-align: center;
}

.details-table td:nth-child(3) {
    width: 60%;
}

/* =========================================
   PDF EXPORT OVERRIDES
   ========================================= */
.pdf-export-mode {
    width: 800px !important;
    max-width: none !important;
    margin: 0 auto;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.pdf-export-mode .biodata-theme-elegant {
    padding: 2px !important;
    border-width: 6px !important;
}

.pdf-export-mode .biodata-body {
    padding: 1rem 1.5rem !important;
    gap: 1.5rem !important;
}

.pdf-export-mode .biodata-header {
    padding: 1.5rem 0 0.5rem !important;
}

.pdf-export-mode .om-symbol {
    font-size: 2rem !important;
    margin-bottom: 0.2rem !important;
}

.pdf-export-mode .biodata-header h1 {
    font-size: 2rem !important;
    margin-bottom: 0 !important;
}

.pdf-export-mode .candidate-name {
    font-size: 1.8rem !important;
    margin-bottom: 1rem !important;
}

.pdf-export-mode .details-section h4 {
    font-size: 1.1rem !important;
    padding: 0.3rem 0.8rem !important;
    margin-bottom: 0.6rem !important;
}

.pdf-export-mode .details-table td {
    padding: 0.25rem 0 !important;
    font-size: 1rem !important;
}

.pdf-export-mode .details-section {
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 1rem !important;
}

.pdf-export-mode .photo-box {
    width: 140px !important;
    height: 180px !important;
}

/* Responsive */
@media (max-width: 768px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
    .input-group.full-width {
        grid-column: span 1;
    }
    .container {
        padding: 1.5rem;
    }
    .biodata-body {
        flex-direction: column;
        align-items: center;
    }
    .biodata-left-col, .biodata-right-col {
        width: 100%;
    }
    .photo-box {
        margin-bottom: 1rem;
    }
    .form-navigation {
        flex-direction: column;
        align-items: stretch;
    }
    .btn {
        justify-content: center;
    }
}

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    body {
        background: none;
        padding: 0;
        margin: 0;
    }

    .background-elements,
    .app-header,
    .progress-container,
    .form-navigation,
    .preview-instruction,
    h2 {
        display: none !important;
    }

    .container {
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 0;
        max-width: 100%;
        margin: 0;
    }

    #main-container {
        padding: 0;
    }

    /* Only show the preview step during print */
    .form-step {
        display: none !important;
    }
    #step-5 {
        display: block !important;
    }

    .biodata-preview-wrapper {
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    .biodata-theme-elegant {
        border-width: 4px;
        page-break-after: avoid;
    }

    .details-section {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    .photo-box {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Print specific color adjustments */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
