/* ============================================================
   DTE Assam Portal — Global Stylesheet
   Design: Official government aesthetic, clean & trustworthy
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@400;600;700&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
    --navy:     #0d2137;
    --navy2:    #163251;
    --navy3:    #1e4474;
    --saffron:  #c8600a;
    --saffron2: #e07820;
    --gold:     #c8963e;
    --gold2:    #e8b560;
    --green:    #1a6b3a;
    --cream:    #f7f4ef;
    --white:    #ffffff;
    --gray1:    #374151;
    --gray2:    #6b7280;
    --gray3:    #9ca3af;
    --light:    #f3f4f6;
    --border:   #d1d5db;
    --red:      #b91c1c;
    --success:  #15803d;
    --radius:   8px;
    --radius-lg:14px;
    --shadow:   0 2px 16px rgba(13,33,55,0.10);
    --shadow-lg:0 8px 40px rgba(13,33,55,0.14);
    --font-body: 'Source Sans 3', sans-serif;
    --font-serif:'Noto Serif', serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--gray1);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

a { color: var(--navy); text-decoration: none; transition: color .2s; }
a:hover { color: var(--saffron); }

img { max-width: 100%; height: auto; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: var(--navy);
    position: sticky; top: 0; z-index: 200;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.nav-top {
    background: var(--navy2);
    padding: 6px 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-top-logo {
    width: 42px; height: 42px;
    object-fit: contain;
    filter: brightness(1.1);
}

.nav-top-text { color: rgba(255,255,255,0.95); }
.nav-top-text .org { font-family: var(--font-serif); font-size: 1rem; font-weight: 700; letter-spacing: 0.2px; }
.nav-top-text .sub { font-size: 0.75rem; color: rgba(255,255,255,0.65); }

.nav-bottom {
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-links a {
    color: rgba(255,255,255,0.80);
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all .2s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active { background: rgba(255,255,255,0.12); color: #fff; }

.nav-links .btn-accent {
    background: var(--saffron);
    color: #fff !important;
    font-weight: 600;
    padding: 6px 16px;
}
.nav-links .btn-accent:hover { background: var(--saffron2); }

.nav-user {
    display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
}
.nav-user-dot {
    width: 30px; height: 30px;
    background: var(--saffron);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem; color: white;
    flex-shrink: 0;
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none; border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column; gap: 5px;
}
.nav-toggle span {
    display: block; width: 22px; height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 2px;
    transition: all .3s;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container      { max-width: 960px;  margin: 0 auto; padding: 2rem 1.25rem; }
.container-lg   { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem; }
.container-sm   { max-width: 520px;  margin: 0 auto; padding: 2rem 1.25rem; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(200,150,62,0.10);
    overflow: hidden;
}

.card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--light);
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, #f8f9ff 0%, #fffbf5 100%);
}
.card-header h2 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--navy);
    font-weight: 600;
}
.card-header .card-icon { font-size: 1.3rem; }

.card-body { padding: 1.5rem; }

/* ============================================================
   SECTION TITLE
   ============================================================ */
.sec-title {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.6rem 1rem;
    background: linear-gradient(90deg, #eef3ff 0%, #fffbf3 100%);
    border-left: 4px solid var(--gold);
    border-radius: 0 6px 6px 0;
    margin: 1.2rem 0 1rem;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-grid   { display: grid; gap: 1rem; }
.form-2col   { grid-template-columns: 1fr 1fr; }
.form-3col   { grid-template-columns: 1fr 1fr 1fr; }
.form-group  { display: flex; flex-direction: column; gap: 4px; }

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--navy2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 9px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.93rem;
    color: var(--gray1);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navy3);
    box-shadow: 0 0 0 3px rgba(30,68,116,0.10);
}

.form-group input[readonly] {
    background: #f9fafb;
    color: var(--gray2);
}

.form-group .hint {
    font-size: 0.75rem;
    color: var(--gray2);
    margin-top: 2px;
}

.marks-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 6px;
}
.marks-sep { color: var(--gray3); font-size: 1.2rem; text-align: center; padding-top: 22px; }

.required { color: var(--red); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.btn-primary   { background: var(--navy);    color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy2); color: #fff; }

.btn-saffron   { background: var(--saffron); color: #fff; border-color: var(--saffron); }
.btn-saffron:hover { background: var(--saffron2); color: #fff; }

.btn-gold      { background: var(--gold);    color: var(--navy); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold2); }

.btn-outline   { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }

.btn-success   { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger    { background: var(--red);     color: #fff; border-color: var(--red); }
.btn-light     { background: var(--light);   color: var(--gray1); border-color: var(--border); }
.btn-light:hover { background: var(--border); }

.btn-sm  { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg  { padding: 13px 32px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 11px 16px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: flex; align-items: flex-start; gap: 10px;
    line-height: 1.5;
}
.alert-icon { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-draft     { background: #f1f5f9; color: #475569; }
.badge-submitted { background: #eff6ff; color: #1e40af; }
.badge-review    { background: #fefce8; color: #854d0e; }
.badge-accepted  { background: #f0fdf4; color: #14532d; }
.badge-rejected  { background: #fef2f2; color: #991b1b; }
.badge-paid      { background: #f0fdf4; color: #14532d; }
.badge-pending   { background: #fffbeb; color: #92400e; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

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

thead th {
    background: var(--navy);
    color: rgba(255,255,255,0.92);
    padding: 10px 14px;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--light);
    font-size: 0.88rem;
    color: var(--gray1);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f9fafb; }

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--gold);
    text-align: center;
}
.stat-card .stat-val {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--gray2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* ============================================================
   DRAG & DROP (Institute Preferences)
   ============================================================ */
.pref-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pref-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: grab;
    user-select: none;
    transition: box-shadow .2s, border-color .2s;
}

.pref-item:active { cursor: grabbing; }
.pref-item.sortable-ghost { opacity: .4; }
.pref-item.sortable-chosen { box-shadow: 0 4px 20px rgba(13,33,55,.15); border-color: var(--gold); }

.pref-rank {
    width: 28px; height: 28px;
    background: var(--navy);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
    flex-shrink: 0;
}

.pref-handle { color: var(--gray3); font-size: 1.2rem; cursor: grab; flex-shrink: 0; }
.pref-name   { font-size: 0.9rem; font-weight: 600; color: var(--navy); }
.pref-addr   { font-size: 0.78rem; color: var(--gray2); margin-top: 2px; }

.pref-item.opted-out { opacity: 0.55; cursor: default; background: var(--light); }
.pref-item.opted-out .pref-handle { display: none; }
.pref-rank-out { background: var(--gray3) !important; }

.pref-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px 9px;
    font-size: .75rem;
    cursor: pointer;
    color: var(--gray2);
    flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.pref-toggle-btn:hover { background: var(--light); color: var(--navy); border-color: var(--gray2); }
.pref-add-btn { color: var(--success); border-color: var(--success); }
.pref-add-btn:hover { background: #f0faf4; color: var(--success); }

/* ============================================================
   CHECKLIST
   ============================================================ */
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.check-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.check-item:hover { border-color: var(--gold); background: #fffdf7; }
.check-item input[type=checkbox] {
    width: 17px; height: 17px;
    accent-color: var(--navy);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}
.check-item span { font-size: 0.87rem; font-weight: 500; line-height: 1.4; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: var(--navy);
    color: rgba(255,255,255,0.55);
    text-align: center;
    padding: 1.4rem 1.5rem;
    font-size: 0.8rem;
    margin-top: 3rem;
}
.footer strong { color: rgba(255,255,255,0.85); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
    background: linear-gradient(150deg, var(--navy) 0%, var(--navy2) 50%, var(--navy3) 100%);
    color: white;
    padding: 3.5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c8963e' fill-opacity='0.05'%3E%3Cpath d='M20 20.5V18H0v-2h20v-2H0v-2h20v-2H0V8h20V6H0V4h20V2H0V0h22v20h2V0h2v20h2V0h2v20h2V0h2v20h2V0h2v20h2v2H20v-1.5zM0 20h2v20H0V20zm4 0h2v20H4V20zm4 0h2v20H8V20zm4 0h2v20h-2V20zm4 0h2v20h-2V20zm4 4h20v2H20v-2zm0 4h20v2H20v-2zm0 4h20v2H20v-2zm0 4h20v2H20v-2z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 0.7rem;
    line-height: 1.25;
}
.hero h1 em { color: var(--gold2); font-style: normal; }
.hero p {
    font-size: 0.97rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 1.8rem;
    max-width: 560px;
    margin-left: auto; margin-right: auto;
}

/* ============================================================
   STEP INDICATOR
   ============================================================ */
.steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 1.5rem 0;
    overflow-x: auto;
    padding-bottom: 4px;
}
.step {
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0;
}
.step-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--light);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700; color: var(--gray2);
    flex-shrink: 0;
}
.step.done .step-circle  { background: var(--success); border-color: var(--success); color: white; }
.step.active .step-circle { background: var(--navy);  border-color: var(--navy);   color: white; }
.step-label { font-size: 0.8rem; font-weight: 600; color: var(--gray2); white-space: nowrap; }
.step.active .step-label { color: var(--navy); }
.step.done .step-label   { color: var(--success); }
.step-line { flex: 1; height: 2px; background: var(--border); min-width: 20px; }
.step.done + .step .step-line,
.step.done ~ .step-line  { background: var(--success); }

/* ============================================================
   PAYMENT STATUS BANNER
   ============================================================ */
.payment-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
}
.payment-banner.paid   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.payment-banner.unpaid { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-bottom { flex-wrap: wrap; height: auto; padding: 8px 1rem; }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 8px 0 12px;
        gap: 2px;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 9px 10px; width: 100%; }

    .nav-user { margin-left: auto; }

    .form-2col, .form-3col { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .check-grid { grid-template-columns: 1fr; }
    .container, .container-lg { padding: 1.25rem 1rem; }
    .card-body { padding: 1.1rem; }
    .hero { padding: 2.5rem 1rem; }
    .btn-lg { padding: 12px 24px; font-size: 0.95rem; }

    .marks-row { grid-template-columns: 1fr auto 1fr; }

    .steps { gap: 0; }
    .step-label { display: none; }
    .step.active .step-label { display: block; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .nav-top-text .org { font-size: 0.88rem; }
    table { font-size: 0.8rem; }
    thead th, tbody td { padding: 8px 10px; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray2); font-size: 0.85rem; }
.text-navy   { color: var(--navy); }
.text-red    { color: var(--red); }
.text-green  { color: var(--success); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; }
.w-100 { width: 100%; }
.hidden { display: none; }

/* ============================================================
   DOCUMENT UPLOAD CARDS
   ============================================================ */
.doc-upload-card {
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    padding: 1.1rem;
    background: #fff;
    transition: border-color .2s;
}
.doc-upload-card:hover { border-color: var(--gold); }
.doc-upload-card.uploaded   { border-top: 3px solid var(--gold); }
.doc-upload-card.verified   { border-top: 3px solid var(--success); background: #f0fdf4; }
.doc-upload-card.missing    { border-top: 3px solid var(--red); }

/* File input styling */
input[type=file] {
    padding: 8px 10px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    background: #fafafa;
    width: 100%;
    font-size: .85rem;
    cursor: pointer;
    transition: border-color .2s;
}
input[type=file]:hover { border-color: var(--navy3); }
