/* Custom Design System for Aspirations Kolkata Admission Form */

:root {
    --primary-color: #0f2d59; /* Royal Deep Blue */
    --primary-light: #1d4b8a;
    --primary-dark: #071730;
    --accent-color: #e28c11; /* Golden Accent */
    --accent-light: #ffaa2b;
    --text-color: #2b3a4a; /* Slate Text */
    --text-muted: #6b7c93;
    --bg-color: #f6f8fb; /* Soft Light Gray-Blue */
    --card-bg: #ffffff;
    --border-color: #d1dbe5;
    --error-color: #df4747;
    --success-color: #2cb57e;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px rgba(15, 45, 89, 0.06);
    --shadow-lg: 0 16px 32px rgba(15, 45, 89, 0.1);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Typography */
h1, h2, h3, h4, .logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Card Container */
.form-container {
    background: var(--card-bg);
    width: 100%;
    max-width: 850px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(15, 45, 89, 0.05);
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* Header styling */
.form-header {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #f0f4f8;
    padding-bottom: 25px;
    margin-bottom: 30px;
}

.logo-area {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 85px;
    height: 85px;
    border-radius: var(--radius-md);
    margin-right: 25px;
    box-shadow: 0 4px 10px rgba(15, 45, 89, 0.2);
}

.logo-text {
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 800;
    line-height: 1.2;
}

.logo-subtext {
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--accent-light);
    font-weight: 600;
    margin-top: 2px;
}

.header-desc h1 {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.header-desc p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Progress Tracker */
.progress-container {
    position: relative;
    margin-bottom: 40px;
    padding: 0 10px;
}

.progress-bar {
    position: absolute;
    top: 20px;
    left: 0;
    height: 4px;
    background: var(--accent-color);
    width: 0%;
    z-index: 1;
    transition: var(--transition);
    border-radius: 2px;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 4px;
    background: #e9eff5;
    z-index: 0;
    border-radius: 2px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
}

.step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #e9eff5;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    color: var(--text-muted);
    transition: var(--transition);
}

.step-indicator.active .step-num {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(15, 45, 89, 0.15);
}

.step-indicator.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

.step-indicator.completed .step-num {
    border-color: var(--success-color);
    background: var(--success-color);
    color: #ffffff;
}

.step-indicator.completed .step-label {
    color: var(--success-color);
}

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

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

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

.form-step h2 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.step-description {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 20px;
}

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

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

.form-group.hidden {
    display: none;
}

label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.required {
    color: var(--error-color);
    font-weight: bold;
    margin-left: 2px;
}

/* Inputs & Selects & Textareas */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14.5px;
    color: var(--text-color);
    background: #ffffff;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-light);
    outline: none;
    box-shadow: 0 0 0 3.5px rgba(29, 75, 138, 0.12);
}

/* Select arrows */
select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%230f2d59' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Radio styling */
.radio-group {
    display: flex;
    gap: 20px;
    height: 48px;
    align-items: center;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.radio-label input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* Checkbox styling */
.checkbox-group {
    margin-top: 5px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-color);
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.declaration-box {
    background: #f8fafc;
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1.5px dashed var(--border-color);
    margin-top: 25px;
}

/* Error States */
.form-group.invalid input,
.form-group.invalid select,
.form-group.invalid textarea,
.form-group.invalid .file-dropzone {
    border-color: var(--error-color);
    background-color: rgba(223, 71, 71, 0.02);
}

.form-group.invalid input:focus,
.form-group.invalid select:focus,
.form-group.invalid textarea:focus {
    box-shadow: 0 0 0 3.5px rgba(223, 71, 71, 0.12);
}

.error-msg {
    color: var(--error-color);
    font-size: 11.5px;
    font-weight: 600;
    margin-top: 5px;
    display: none;
}

.form-group.invalid .error-msg {
    display: block;
}

/* File Dropzones */
.file-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #fafbfe;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    min-height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.file-dropzone:hover, .file-dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(15, 45, 89, 0.02);
}

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

.dropzone-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 1;
}

.upload-icon {
    width: 36px;
    height: 36px;
    color: var(--primary-light);
    margin-bottom: 12px;
    opacity: 0.85;
}

.dropzone-text .primary-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.dropzone-text .primary-text span {
    color: var(--primary-color);
    text-decoration: underline;
}

.dropzone-text .secondary-text {
    font-size: 11px;
    color: var(--text-muted);
}

.file-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
    padding: 10px;
}

.file-preview img {
    max-height: 100px;
    max-width: 100px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.file-name-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
}

.remove-file {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--text-color);
    cursor: pointer;
    z-index: 4;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file:hover {
    background: var(--error-color);
    color: #ffffff;
}

/* Review Step Styling */
.review-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.review-section {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.review-section h3 {
    font-size: 14px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 6px;
}

.review-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}

.review-row:last-child {
    margin-bottom: 0;
}

.review-item {
    font-size: 13.5px;
    color: var(--text-color);
}

.review-lbl {
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 6px;
}

.review-val {
    font-weight: 500;
}

/* Navigation Controls */
.form-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px solid #f0f4f8;
}

button {
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(15, 45, 89, 0.15);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 45, 89, 0.2);
}

.btn-secondary {
    background: #eef2f6;
    color: var(--primary-color);
    margin-right: auto;
}

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

/* Spinner Overlay for AJAX */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.loader-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e2e8f0;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-overlay p {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }
    
    .form-container {
        padding: 25px 20px;
    }
    
    .form-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .logo-area {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .review-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .step-label {
        display: none; /* Hide labels on mobile to save space */
    }
    
    .step-num {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* Confirmation/Receipt Styling */
.success-card {
    text-align: center;
    padding: 30px 10px;
}

.success-icon {
    width: 72px;
    height: 72px;
    background: rgba(44, 181, 126, 0.1);
    color: var(--success-color);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}

.success-icon svg {
    width: 36px;
    height: 36px;
}

.success-card h1 {
    color: var(--primary-color);
    font-size: 26px;
    margin-bottom: 10px;
}

.success-card p {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.receipt-details {
    text-align: left;
    max-width: 550px;
    margin: 0 auto 40px auto;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    padding: 25px;
}

.receipt-header {
    border-bottom: 1.5px solid #e2e8f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.receipt-header h3 {
    font-size: 15px;
    color: var(--primary-color);
}

.app-badge {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
}

.receipt-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e8f0;
}

.receipt-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.receipt-label {
    color: var(--text-muted);
    font-weight: 500;
}

.receipt-value {
    color: var(--text-color);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Utilities */
.hidden {
    display: none !important;
}

.duplicate-error-box {
    background: #fff5f5;
    border: 1.5px solid #feb2b2;
    border-radius: var(--radius-sm);
    color: var(--error-color);
    padding: 15px;
    margin-bottom: 25px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.5;
}
.duplicate-error-box p {
    margin-bottom: 8px;
}
.duplicate-error-box p:last-child {
    margin-bottom: 0;
}
.duplicate-error-box ul {
    margin-left: 20px;
    margin-bottom: 8px;
}
.duplicate-error-box strong {
    font-weight: 700;
}

/* Print Layout Optimization */
@media print {
    body {
        background: #ffffff;
        color: #000000;
        padding: 0;
    }
    
    .form-container {
        box-shadow: none;
        border: none;
        padding: 0;
        max-width: 100%;
    }
    
    .progress-container,
    .form-nav,
    .action-buttons,
    .logo-area,
    .success-icon {
        display: none !important;
    }
    
    .receipt-details {
        max-width: 100%;
        border: none;
        background: #ffffff;
        padding: 0;
    }
    
    .receipt-row {
        border-bottom: 1px solid #ddd;
        padding: 10px 0;
    }
    
    .header-desc {
        text-align: center;
        width: 100%;
    }
    
    .header-desc h1 {
        font-size: 28px;
    }
}
