/* ================================================================
   Registration Management System - Premium CSS
   Emancipation Edutech Private Limited
   ================================================================ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ── CSS Custom Properties ────────────────────────────────────── */
:root {
    /* Brand Colors */
    --primary: #6C3CE1;
    --primary-light: #8B5CF6;
    --primary-dark: #5521CC;
    --primary-glow: rgba(108, 60, 225, 0.3);
    
    --accent: #06D6A0;
    --accent-light: #34E0B5;
    --accent-dark: #05B384;
    
    /* Semantic */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    /* Neutrals */
    --bg: #F8F9FC;
    --bg-card: #FFFFFF;
    --bg-input: #F1F3F9;
    --border: #E2E8F0;
    --border-focus: var(--primary);
    --text: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px var(--primary-glow);
    
    /* Layout */
    --radius: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --max-width: 720px;
    --header-height: 64px;
    
    /* Transitions */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.3s;
}

/* ── Dark Mode (Auto) ────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F1117;
        --bg-card: #1A1D2E;
        --bg-input: #252840;
        --border: #2D3154;
        --text: #E8ECF4;
        --text-secondary: #9CA3C0;
        --text-muted: #6B7194;
        --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
        --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
        --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
    }
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Animated Background ──────────────────────────────────────── */
.bg-gradient {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 400px;
    background: linear-gradient(135deg, var(--primary) 0%, #4F46E5 40%, #7C3AED 100%);
    z-index: -1;
    overflow: hidden;
}
.bg-gradient::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    top: -200px; right: -100px;
    animation: floatBlob 8s ease-in-out infinite;
}
.bg-gradient::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(6,214,160,0.15) 0%, transparent 70%);
    bottom: -100px; left: -50px;
    animation: floatBlob 10s ease-in-out infinite reverse;
}

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

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(108, 60, 225, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}
.logo-icon {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}
.logo-text span {
    color: var(--accent-light);
}

.header-actions {
    display: flex;
    gap: 8px;
}
.btn-track {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
}
.btn-track:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

/* ── Main Container ───────────────────────────────────────────── */
.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 16px 40px;
    position: relative;
    z-index: 1;
}

/* ── Form Card ────────────────────────────────────────────────── */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.6s var(--ease);
}

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

.form-card-header {
    background: linear-gradient(135deg, var(--primary), #4F46E5);
    padding: 28px 24px;
    color: #fff;
    text-align: center;
}
.form-card-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.form-card-header p {
    font-size: 0.9rem;
    opacity: 0.85;
}

.form-body {
    padding: 24px 20px;
}

/* ── Progress Stepper ─────────────────────────────────────────── */
.stepper {
    position: sticky;
    top: var(--header-height);
    z-index: 50;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }

.step-item {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.step-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--duration) var(--ease);
}
.step-item.active .step-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.step-item.completed .step-dot {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.step-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    display: none;
}
.step-item.active .step-label { color: var(--primary); display: block; }
.step-connector {
    width: 20px; height: 2px;
    background: var(--border);
    flex-shrink: 0;
    border-radius: 2px;
    transition: background var(--duration) var(--ease);
}
.step-item.completed + .step-connector,
.step-item.completed ~ .step-connector {
    background: var(--success);
}

@media (min-width: 640px) {
    .step-label { display: block; }
    .step-connector { width: 30px; }
}

/* ── Form Sections ────────────────────────────────────────────── */
.form-section {
    display: none;
    animation: fadeIn 0.4s var(--ease);
}
.form-section.active { display: block; }

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

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.section-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
}
.section-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}
.section-title p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ── Form Controls ────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 480px) {
    .form-grid.two-col { grid-template-columns: 1fr 1fr; }
}
.form-grid .full-width { grid-column: 1 / -1; }

.form-group {
    position: relative;
}
.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    transition: all var(--duration) var(--ease);
    appearance: none;
    -webkit-appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(239,68,68,0.15);
}
.form-control.valid {
    border-color: var(--success);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.error-message {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 4px;
    display: none;
    align-items: center;
    gap: 4px;
    animation: shakeIn 0.3s var(--ease);
}
.error-message.show { display: flex; }

@keyframes shakeIn {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ── File Upload ──────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    background: var(--bg-input);
    position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(108,60,225,0.05);
}
.upload-zone.has-file {
    border-color: var(--success);
    background: rgba(16,185,129,0.05);
}
.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-icon { font-size: 2rem; margin-bottom: 8px; }
.upload-text { font-size: 0.85rem; color: var(--text-secondary); }
.upload-text strong { color: var(--primary); }
.upload-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }
.upload-preview {
    margin-top: 12px;
    display: none;
}
.upload-preview.show { display: flex; align-items: center; gap: 10px; justify-content: center; }
.upload-preview img {
    width: 48px; height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--border);
}
.upload-preview .file-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--success);
}

/* ── Payment Section ──────────────────────────────────────────── */
.payment-card {
    background: linear-gradient(135deg, #1A1D2E, #252840);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    color: #fff;
    margin-bottom: 20px;
}
.payment-amount {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-light);
    margin: 12px 0;
}
.payment-amount span { font-size: 1.2rem; vertical-align: top; }
.qr-container {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    display: inline-block;
    margin: 16px 0;
}
.qr-container img {
    width: 180px; height: 180px;
    border-radius: 8px;
}
.upi-id-display {
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-full);
    padding: 8px 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin-top: 8px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}
.upi-id-display:hover { background: rgba(255,255,255,0.2); }
.copy-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}

/* ── Declaration ──────────────────────────────────────────────── */
.declaration-box {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin-top: 12px;
}
.checkbox-wrapper input[type="checkbox"] {
    width: 20px; height: 20px;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}
.checkbox-wrapper label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ── Navigation Buttons ───────────────────────────────────────── */
.form-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--duration) var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-prev {
    background: var(--bg-input);
    color: var(--text-secondary);
    flex: 0.4;
}
.btn-prev:hover {
    background: var(--border);
    color: var(--text);
}
.btn-next, .btn-submit {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-next:hover, .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--primary-glow);
}
.btn-next:active, .btn-submit:active {
    transform: translateY(0);
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Toast Notification ───────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    max-width: 400px;
    animation: toastIn 0.4s var(--ease);
    border-left: 4px solid var(--info);
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast-icon { font-size: 1.3rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-size: 0.85rem; font-weight: 600; }
.toast-message { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.toast-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ── Success Screen ───────────────────────────────────────────── */
.success-screen {
    text-align: center;
    padding: 40px 20px;
    display: none;
}
.success-screen.show { display: block; animation: scaleIn 0.5s var(--ease); }

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.success-checkmark {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: #fff;
    box-shadow: 0 10px 30px rgba(16,185,129,0.3);
}
.success-screen h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 8px;
}
.success-screen .reg-id-display {
    background: var(--bg-input);
    border-radius: var(--radius);
    padding: 16px;
    margin: 20px 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
}

/* ── Status Tracker Modal ─────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s var(--ease);
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
    background: var(--bg-input);
    border: none;
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.modal-body { padding: 24px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.status-badge.pending { background: rgba(245,158,11,0.15); color: #D97706; }
.status-badge.approved { background: rgba(16,185,129,0.15); color: #059669; }
.status-badge.rejected { background: rgba(239,68,68,0.15); color: #DC2626; }
.status-badge.on_hold { background: rgba(59,130,246,0.15); color: #2563EB; }

/* ── Loading Spinner ──────────────────────────────────────────── */
.spinner {
    width: 20px; height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    color: #fff;
}
.loading-overlay.show { display: flex; }
.loading-overlay .spinner { width: 40px; height: 40px; border-width: 4px; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.site-footer a {
    color: var(--primary-light);
    text-decoration: none;
}

/* ── Utilities ────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (min-width: 768px) {
    .main-container { padding: 30px 24px 60px; }
    .form-body { padding: 32px; }
    .form-card-header { padding: 36px 32px; }
    .form-card-header h1 { font-size: 1.8rem; }
}
