/* =============================================
   Student Verification Portal — Premium Dark Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@500;600;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a1f35;
    --bg-card: rgba(17, 24, 39, 0.7);
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: rgba(99, 102, 241, 0.2);
    --glass-bg: rgba(17, 24, 39, 0.6);
    --glass-border: rgba(99, 102, 241, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ---- Animated Background ---- */
.bg-animated {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1040 25%, #0d1f3c 50%, #0a2a2a 75%, #0a0e1a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 0%; }
    75% { background-position: 0% 100%; }
}

/* Particles */
.particles {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    animation: floatUp linear infinite;
}
.particle:nth-child(1) { left: 10%; animation-duration: 12s; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-duration: 15s; animation-delay: 2s; }
.particle:nth-child(3) { left: 40%; animation-duration: 10s; animation-delay: 4s; }
.particle:nth-child(4) { left: 55%; animation-duration: 18s; animation-delay: 1s; }
.particle:nth-child(5) { left: 70%; animation-duration: 14s; animation-delay: 3s; }
.particle:nth-child(6) { left: 85%; animation-duration: 11s; animation-delay: 5s; }
.particle:nth-child(7) { left: 15%; animation-duration: 16s; animation-delay: 6s; }
.particle:nth-child(8) { left: 60%; animation-duration: 13s; animation-delay: 7s; }

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

a { color: var(--accent-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-secondary); }

/* ---- Glass Card ---- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}
.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-glow);
}
.glass-card + .glass-card { margin-top: 24px; }

/* ---- Navbar ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}
.navbar-brand img { height: 36px; width: 36px; border-radius: 8px; }
.navbar-user {
    display: flex;
    align-items: center;
    gap: 14px;
}
.navbar-user span { font-size: 0.9rem; color: var(--text-secondary); }

/* ---- Avatar ---- */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    object-fit: cover;
    transition: var(--transition);
}
.avatar:hover { border-color: var(--accent-secondary); transform: scale(1.05); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    line-height: 1.4;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}
.btn-success {
    background: linear-gradient(135deg, var(--accent-success), #059669);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover:not(:disabled) {
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}
.btn-danger {
    background: linear-gradient(135deg, var(--accent-danger), #dc2626);
    color: #fff;
}
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-outline:hover { border-color: var(--accent-primary); background: rgba(99, 102, 241, 0.1); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

.btn-google {
    background: #ffffff;
    color: #374151;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    font-size: 1rem;
}
.btn-google:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transform: translateY(-2px);
}
.btn-google svg { width: 20px; height: 20px; }

/* ---- Forms ---- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    transition: var(--transition);
}
.form-label .required { color: var(--accent-danger); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(75, 85, 99, 0.4);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(31, 41, 55, 1);
}
.form-control:read-only {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(31, 41, 55, 0.4);
}
.form-control.is-valid { border-color: var(--accent-success); }
.form-control.is-invalid { border-color: var(--accent-danger); }

textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
select.form-control option { background: var(--bg-secondary); color: var(--text-primary); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.validation-icon {
    position: absolute;
    right: 12px;
    top: 38px;
    font-size: 1rem;
}
.validation-icon.valid { color: var(--accent-success); }
.validation-icon.invalid { color: var(--accent-danger); }

/* ---- Section Header ---- */
.section-header {
    margin-bottom: 24px;
    padding-bottom: 12px;
    position: relative;
}
.section-header h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-header h2 .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    font-size: 1rem;
}
.section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

/* ---- Upload Zone ---- */
.upload-zone {
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(99, 102, 241, 0.03);
    position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}
.upload-zone .upload-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}
.upload-zone .upload-text { color: var(--text-secondary); font-size: 0.95rem; }
.upload-zone .upload-hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 6px; }
.upload-zone input[type="file"] { display: none; }

.photo-preview {
    display: none;
    text-align: center;
    padding: 20px;
}
.photo-preview img {
    width: 150px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 3px solid var(--accent-primary);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}
.photo-preview .btn { margin-top: 12px; }

/* ---- Crop Modal ---- */
.crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.crop-modal.active { display: flex; }
.crop-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
}
.crop-container h3 {
    margin-bottom: 16px;
    font-size: 1.2rem;
    text-align: center;
}
.crop-image-wrapper {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    background: #000;
}
.crop-image-wrapper img { max-width: 100%; display: block; }
.crop-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ---- Fee Items ---- */
.fee-item {
    display: grid;
    grid-template-columns: 1fr 150px 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    animation: slideUp 0.3s ease;
}
.fee-item .btn-remove {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-danger);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}
.fee-item .btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--accent-danger);
}
.fee-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-weight: 600;
    font-size: 1.05rem;
}
.fee-total span:last-child { color: var(--accent-success); font-size: 1.15rem; }

/* ---- Credential Display ---- */
.credential-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    min-width: 180px;
}
.credential-box .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.credential-box .value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: 0.05em;
}
.credentials-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* ---- Document Cards ---- */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.doc-card {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
}
.doc-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}
.doc-card .doc-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    font-size: 1.3rem;
}
.doc-card .doc-name { font-weight: 600; font-size: 0.95rem; }
.doc-card .doc-date { font-size: 0.8rem; color: var(--text-muted); }
.doc-card .doc-actions { margin-top: auto; display: flex; gap: 8px; }

/* ---- Step Indicators ---- */
.steps {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 32px;
    flex-wrap: wrap;
}
.step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
}
.step.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
}
.step.completed {
    color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}
.step .step-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(75, 85, 99, 0.5);
}
.step.active .step-num { background: var(--accent-primary); color: #fff; }
.step.completed .step-num { background: var(--accent-success); color: #fff; }
.step-connector {
    width: 24px;
    height: 2px;
    background: rgba(75, 85, 99, 0.4);
    align-self: center;
}

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: #fff;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255,255,255,0.3);
    animation: toastTimer 5s linear forwards;
}
.toast.success { background: linear-gradient(135deg, #059669, #10b981); }
.toast.error { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast.info { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.toast.removing { animation: slideOut 0.3s ease forwards; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }
@keyframes toastTimer { from { width: 100%; } to { width: 0%; } }

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

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
}
.loading-overlay.active { display: flex; }
.loading-overlay .spinner { width: 48px; height: 48px; border-width: 4px; }
.loading-overlay p { color: var(--text-secondary); font-size: 1rem; }

/* ---- Progress Bar ---- */
.progress-bar-wrapper {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: rgba(75,85,99,0.4);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ---- Badge ---- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--accent-success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--accent-warning); }
.badge-info { background: rgba(99,102,241,0.15); color: var(--accent-primary); }

/* ---- Animations ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.fade-in { animation: fadeIn 0.5s ease; }
.slide-up { animation: slideUp 0.5s ease; }

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    text-align: center;
    max-width: 440px;
    width: 100%;
    padding: 48px 40px;
}
.login-card .crest { width: 90px; height: 90px; margin: 0 auto 20px; }
.login-card .crest img { width: 100%; height: 100%; object-fit: contain; }
.login-card h1 { font-size: 1.7rem; margin-bottom: 6px; }
.login-card .subtitle { color: var(--accent-primary); font-size: 0.95rem; font-weight: 500; margin-bottom: 8px; }
.login-card .description { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 32px; line-height: 1.5; }
.login-card .btn-google { margin: 0 auto; }
.login-footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- Dashboard Layout ---- */
.dashboard { padding-top: 80px; padding-bottom: 40px; }
.container { max-width: 920px; margin: 0 auto; padding: 0 20px; }
.welcome-msg {
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 4px;
}
.welcome-sub { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 8px; }

.form-section { display: none; }
.form-section.active { display: block; animation: fadeIn 0.4s ease; }

.section-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 12px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .navbar { padding: 0 16px; }
    .glass-card { padding: 20px 18px; }
    .login-card { padding: 32px 24px; }
    .steps { gap: 4px; }
    .step { padding: 6px 10px; font-size: 0.78rem; }
    .step-connector { width: 12px; }
    .doc-grid { grid-template-columns: 1fr; }
    .fee-item { grid-template-columns: 1fr 120px 36px; }
    .credentials-row { flex-direction: column; align-items: center; }
    .container { padding: 0 14px; }
}
@media (max-width: 480px) {
    .navbar-user span { display: none; }
    .steps { flex-direction: column; align-items: center; }
    .step-connector { width: 2px; height: 12px; }
}
