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

:root {
    /* Excellence Color Palette */
    --primary: #2563eb;
    --primary-soft: rgba(37, 99, 235, 0.08);
    --secondary: #0ea5e9;
    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --error: #dc2626;

    /* Surface Colors */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);

    /* Text Colors - High Contrast */
    --text-main: #0f172a;
    --text-heading: #1e293b;
    --text-muted: #475569;
    --text-light: #94a3b8;

    /* Misc */
    --border-base: #e2e8f0;
    --border-accent: #cbd5e1;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-subtle: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-floating: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
.logo,
.nav-links a {
    font-family: 'Outfit', sans-serif;
    color: var(--text-heading);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
}

/* Header & Logo */
header {
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-base);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 1.5rem;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    background: #e2e8f0;
    padding: 0.5rem;
    border-radius: 16px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
    color: var(--text-heading);
}

.nav-links a.active {
    background: var(--bg-card);
    color: var(--primary);
    box-shadow: var(--shadow-subtle);
}

/* Cards & Layout */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-base);
    border-radius: var(--radius-lg);
    padding: 3.5rem;
    box-shadow: var(--shadow-elevated);
}

.section-hero {
    margin-bottom: 3rem;
    text-align: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Form Styles */
.form-grid-excellence {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    max-width: 1400px;
    margin: 0 auto;
    gap: 4rem;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.grid-responsive-address {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid-responsive-address {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .form-grid-excellence {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .card {
        padding: 2rem;
    }
    .section-title {
        font-size: 1.5rem;
    }
}

.form-group {
    margin-bottom: 2rem;
}

.label-excellence {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}

.icon-box {
    width: 24px;
    height: 24px;
    color: var(--primary);
    opacity: 0.8;
}

input,
select,
textarea {
    width: 100%;
    background: #f8fafc;
    border: 2px solid var(--border-base);
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

@media (max-width: 480px) {
    input, select, textarea {
        font-size: 16px; /* Prevents iOS zoom-on-focus */
        padding: 0.75rem;
    }
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 5px var(--primary-soft);
}

/* Buttons */
.btn {
    padding: 1.125rem 2.25rem;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border-base);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

/* ID Card Excellence */
.id-preview-excellence {
    background: hsl(0, 0%, 100%);
    border-radius: var(--radius-lg);
    padding: 3rem;
    border: 2px solid #e2e8f0;
    display: grid;
    place-items: center;
    text-align: center;
    position: sticky;
    top: 100px;
}

@media (max-width: 768px) {
    .id-preview-excellence {
        padding: 1.5rem;
        position: static;
    }
    .id-card-modern {
        transform: scale(0.9);
        transform-origin: top center;
    }
}

@media (max-width: 480px) {
    .id-preview-excellence {
        padding: 1rem;
        background: transparent;
        border: none;
    }
    .id-card-modern {
        width: 100%;
        min-width: unset;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }
    .student-info-well {
        padding: 1rem;
    }
    .grid-2-col {
        gap: 1rem;
    }
}

/* Fix for Prefix Select Wrapping */
.prefix-group {
    display: flex; 
    gap: 0.75rem; 
    align-items: stretch;
}

@media (max-width: 400px) {
    .prefix-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .prefix-group select {
        width: 100% !important;
        min-width: 100% !important;
    }
}

.id-card-modern {
    width: 100%;
    max-width: 360px;
    min-height: 600px;
    height: auto;
    padding-bottom: 2rem;
    margin: 0 auto;
    background: white;
    border-radius: 28px;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.12), 0 18px 36px -18px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 380px) {
    .id-card-modern {
        border-radius: 15px;
    }
}

.id-card-top-accent {
    height: 100px;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
}

.school-badge {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.school-name-modern {
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    padding: 0 1rem;
}

.photo-well {
    margin-top: -50px;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.photo-frame {
    width: 120px;
    height: 140px;
    background: white;
    padding: 6px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 800;
    font-size: 0.75rem;
    text-align: center;
    padding: 10px;
    word-break: break-all;
}

.student-info-well {
    padding: 1.5rem 2rem 1rem;
    flex-grow: 1;
}

.student-name-display {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.25rem;
}

.student-class-display {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.data-row {
    margin-bottom: 0.8rem;
    text-align: left;
}

.data-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.15rem;
}

.data-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-heading);
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.25rem;
}

.id-card-footer {
    padding: 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.id-card-footer span {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

/* Status Pills */
.pill {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
}

.pill-success {
    background: var(--success-soft);
    color: var(--success);
}

/* Tables */
.table-excellence {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.table-excellence th {
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    text-align: left;
}

.table-excellence tr td {
    background: white;
    padding: 1.5rem;
    border-top: 1px solid var(--border-base);
    border-bottom: 1px solid var(--border-base);
}

.table-excellence tr td:first-child {
    border-left: 1px solid var(--border-base);
    border-radius: 12px 0 0 12px;
}

.table-excellence tr td:last-child {
    border-right: 1px solid var(--border-base);
    border-radius: 0 12px 12px 0;
}

@media (max-width: 1100px) {
    .form-grid-excellence {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .id-preview-excellence {
        padding: 2rem;
    }
}

/* Modal & Review */
.modal-overlay {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.review-item {
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-base);
}

.review-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.review-value {
    font-weight: 600;
    color: var(--text-heading);
    word-break: break-word;
}

@media (max-width: 600px) {
    .review-grid {
        grid-template-columns: 1fr;
    }
}