:root {
    --navy: #05104c;
    --navy-2: #0d1f7a;
    --pink: #e91e63;
    --pink-2: #ff5c8a;
    --violet: #673ab7;
    --ink: #1a1f36;
    --muted: #6b7280;
    --bg: #f6f7fb;
    --card: #ffffff;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(5, 16, 76, .08);
    --shadow-lg: 0 20px 50px rgba(5, 16, 76, .16);
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn-brand {
    background: linear-gradient(135deg, var(--pink), var(--pink-2));
    color: #fff;
    border: 0;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(233, 30, 99, .3);
    transition: transform .15s, box-shadow .15s;
}
.btn-brand:hover, .btn-brand:focus { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(233, 30, 99, .4); }
.btn-brand:disabled { opacity: .75; transform: none; }
.btn-outline-light { border-radius: 12px; font-weight: 600; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; }

/* ---------- Nav ---------- */
.portal-nav {
    background: rgba(5, 16, 76, .92);
    backdrop-filter: blur(10px);
    padding: .7rem 0;
}
.portal-nav .navbar-brand { color: #fff; }
.brand-logo { width: 44px; height: 44px; object-fit: cover; border-radius: 12px; background: #fff; }
.brand-name { font-weight: 800; font-size: 1.15rem; line-height: 1; }
.brand-sub { font-size: .7rem; color: rgba(255, 255, 255, .6); letter-spacing: .06em; text-transform: uppercase; }
.portal-nav .nav-link { color: rgba(255, 255, 255, .8); font-weight: 500; }
.portal-nav .nav-link:hover { color: #fff; }
.navbar-toggler { color: #fff; border: 0; font-size: 1.6rem; box-shadow: none !important; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: 90px 0 110px;
    background:
        radial-gradient(circle at 15% 20%, rgba(103, 58, 183, .55), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(233, 30, 99, .45), transparent 45%),
        linear-gradient(160deg, var(--navy), var(--navy-2));
}
.hero::after {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.hero-pill {
    display: inline-flex; gap: .4rem; align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    padding: .4rem .9rem; border-radius: 99px; font-size: .85rem; margin-bottom: 1.2rem;
}
.hero-title { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 800; line-height: 1.12; margin-bottom: 1.2rem; }
.text-gradient { background: linear-gradient(90deg, #ff8fb1, #ffd36e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 1.1rem; color: rgba(255, 255, 255, .78); max-width: 560px; margin-bottom: 2rem; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; position: relative; z-index: 1; }
.stat-card {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius);
    padding: 1.4rem;
    backdrop-filter: blur(6px);
    transition: transform .2s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-card i { font-size: 1.4rem; color: #ff8fb1; }
.stat-num { font-size: 2rem; font-weight: 800; margin-top: .4rem; }
.stat-label { font-size: .85rem; color: rgba(255, 255, 255, .7); }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; margin-bottom: 2.5rem; }
.section-head h2 { font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.eyebrow {
    display: inline-block; color: var(--pink); font-weight: 700;
    text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; margin-bottom: .5rem;
}

/* ---------- Filter ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.search-box { position: relative; flex: 1 1 280px; max-width: 420px; }
.search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .form-control { padding: .8rem 1rem .8rem 2.6rem; border-radius: 12px; border: 1px solid #e5e7eb; box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
    border: 1px solid #e5e7eb; background: #fff; color: var(--ink);
    padding: .5rem 1rem; border-radius: 99px; font-weight: 600; font-size: .85rem; transition: all .15s;
}
.chip:hover { border-color: var(--pink); color: var(--pink); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Internship card ---------- */
.intern-card {
    background: var(--card); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); height: 100%; display: flex; flex-direction: column;
    transition: transform .25s, box-shadow .25s;
}
.intern-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.intern-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e9ebf5; }
.intern-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.intern-card:hover .intern-media img { transform: scale(1.06); }
.mode-badge {
    position: absolute; top: 14px; left: 14px;
    background: rgba(5, 16, 76, .85); color: #fff; font-size: .75rem; font-weight: 600;
    padding: .35rem .75rem; border-radius: 99px; backdrop-filter: blur(4px);
}
.intern-body { padding: 1.4rem; display: flex; flex-direction: column; flex: 1; }
.intern-title { font-size: 1.15rem; font-weight: 700; min-height: 2.8em; margin-bottom: 1rem; }
.intern-meta { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.intern-meta li { display: flex; gap: .6rem; align-items: flex-start; background: var(--bg); padding: .7rem; border-radius: 12px; font-weight: 600; font-size: .9rem; }
.intern-meta i { color: var(--violet); font-size: 1.1rem; }
.intern-meta small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.intern-body .btn-register { margin-top: auto; }
.pay-wrap { border-top: 1px dashed #e5e7eb; margin-top: 1.1rem; padding-top: 1rem; text-align: center; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.empty-state.small-pad { padding: 1.5rem; }

/* ---------- Steps ---------- */
.step-card {
    position: relative; background: var(--bg); border-radius: var(--radius);
    padding: 2rem 1.5rem; height: 100%; transition: transform .2s;
}
.step-card:hover { transform: translateY(-4px); }
.step-card i { font-size: 2rem; color: var(--pink); }
.step-card h5 { font-weight: 700; margin: 1rem 0 .4rem; }
.step-card p { color: var(--muted); margin: 0; }
.step-no { position: absolute; top: 1rem; right: 1.2rem; font-size: 2.6rem; font-weight: 800; color: rgba(5, 16, 76, .07); }

/* ---------- Track ---------- */
.track-card { background: #fff; border-radius: 24px; padding: 2.5rem; box-shadow: var(--shadow); }
.track-card h2 { font-weight: 800; }
.track-card .input-group-text { background: var(--bg); font-weight: 600; }
.reg-item { border: 1px solid #eceef5; border-radius: 14px; padding: 1rem 1.2rem; background: var(--bg); }
.reg-item-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.rid { font-family: ui-monospace, monospace; font-weight: 700; color: var(--navy); letter-spacing: .06em; }
.badge-status { font-size: .75rem; font-weight: 600; color: #15803d; background: #dcfce7; padding: .25rem .6rem; border-radius: 99px; }

/* ---------- Modal ---------- */
.reg-modal { border: 0; border-radius: 22px; overflow: hidden; }
.reg-modal-head {
    position: relative; color: #fff; padding: 1.6rem 1.8rem 1.4rem;
    background: linear-gradient(135deg, var(--navy), var(--violet));
}
.reg-modal-head .btn-close { position: absolute; top: 1.2rem; right: 1.2rem; }
.reg-modal-head h4 { font-weight: 800; padding-right: 2rem; }
.stepper { display: flex; align-items: center; gap: .5rem; }
.st { display: flex; align-items: center; gap: .45rem; font-size: .82rem; color: rgba(255, 255, 255, .6); font-weight: 600; white-space: nowrap; }
.st span {
    width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    border: 2px solid rgba(255, 255, 255, .4); font-size: .75rem;
}
.st.active { color: #fff; }
.st.active span { background: var(--pink); border-color: var(--pink); }
.st.done span { background: #22c55e; border-color: #22c55e; color: #fff; }
.st-line { flex: 1; height: 2px; background: rgba(255, 255, 255, .25); }
.reg-modal .form-control, .reg-modal .form-select { border-radius: 10px; padding: .65rem .9rem; }
.reg-modal .form-label { font-weight: 600; font-size: .88rem; }
.invalid-msg { color: #dc2626; font-size: .85rem; min-height: 1.2em; }

.done-icon {
    width: 72px; height: 72px; margin: 0 auto; border-radius: 50%;
    display: grid; place-items: center; font-size: 2.2rem; color: #fff;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 10px 25px rgba(34, 197, 94, .35);
    animation: pop .4s ease-out;
}
.done-icon.warn { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 10px 25px rgba(245, 158, 11, .35); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 80% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }

.ticket { border: 2px dashed #d7dbea; border-radius: 16px; overflow: hidden; }
.ticket-head {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    background: var(--navy); color: #fff; padding: 1rem 1.3rem;
}
.ticket-head span { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.ticket-head strong { font-family: ui-monospace, monospace; font-size: 1.3rem; letter-spacing: .1em; }
.ticket-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.2rem 1.3rem; margin: 0; }
.ticket-body dt { font-size: .75rem; color: var(--muted); font-weight: 500; }
.ticket-body dd { margin: 0; font-weight: 700; }

/* ---------- Footer ---------- */
.portal-footer { background: var(--navy); color: #fff; padding: 60px 0 24px; }
.footer-title { text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; color: rgba(255, 255, 255, .55); margin-bottom: 1rem; }
.footer-list li { margin-bottom: .6rem; color: rgba(255, 255, 255, .8); display: flex; gap: .6rem; }
.footer-list a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.footer-list a:hover { color: var(--pink-2); }

/* ---------- Responsive ---------- */
@media (max-width: 575px) {
    .hero { padding: 60px 0 80px; }
    .track-card { padding: 1.5rem; }
    .st { font-size: 0; gap: 0; }
    .st span { font-size: .75rem; }
    .ticket-body { grid-template-columns: 1fr; }
}

/* ---------- Print just the ticket ---------- */
@media print {
    body.print-ticket * { visibility: hidden; }
    body.print-ticket #ticket, body.print-ticket #ticket * { visibility: visible; }
    body.print-ticket #ticket { position: fixed; top: 20px; left: 20px; right: 20px; }
    body.print-ticket .ticket-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ================= v2: track, pay, recognition ================= */
.btn-nav-outline { color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 12px; font-weight: 600; }
.btn-nav-outline:hover { background: #fff; color: var(--navy); }
.link-pink { color: var(--pink) !important; text-decoration: none; }
.link-pink:hover { text-decoration: underline; }

/* Page hero (track page) */
.page-hero {
    position: relative; color: #fff; padding: 60px 0 110px; overflow: hidden;
    background:
        radial-gradient(circle at 15% 20%, rgba(103, 58, 183, .55), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(233, 30, 99, .45), transparent 45%),
        linear-gradient(160deg, var(--navy), var(--navy-2));
}
.page-hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: .6rem; }
.track-lift { margin-top: -70px; position: relative; z-index: 2; box-shadow: var(--shadow-lg); }
.legend { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .85rem; color: var(--muted); }

/* Status badges */
.status-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; padding: .3rem .7rem; border-radius: 99px; white-space: nowrap; }
.status-badge.ok { background: #dcfce7; color: #15803d; }
.status-badge.warn { background: #fef3c7; color: #b45309; }
.status-badge.info { background: #dbeafe; color: #1d4ed8; }
.status-badge.muted { background: #eef0f5; color: #4b5563; }

/* Registration status card */
.reg-card { background: #fff; border: 1px solid #eceef5; border-radius: 16px; padding: 1.2rem 1.3rem; height: 100%; display: flex; flex-direction: column; box-shadow: 0 4px 14px rgba(5,16,76,.05); }
.reg-card.is-pending { border-color: #fcd34d; box-shadow: 0 6px 18px rgba(245,158,11,.12); }
.reg-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.reg-card-head small { color: var(--muted); font-size: .72rem; }
.reg-course { font-weight: 800; font-size: 1.05rem; margin: .7rem 0 .3rem; }
.reg-project { font-size: .85rem; color: var(--violet); margin-bottom: .4rem; }
.reg-kv { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; margin: .6rem 0 0; }
.reg-kv dt { font-size: .7rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.reg-kv dd { margin: 0; font-weight: 600; font-size: .9rem; word-break: break-word; }
.reg-status-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; background: var(--bg); border-radius: 12px; padding: .8rem; margin: 1rem 0; }
.reg-status-row small { display: block; color: var(--muted); font-size: .72rem; margin-bottom: .3rem; }
.reg-pay { margin-top: auto; }

/* Pay modal */
.pay-head { position: relative; color: #fff; padding: 1.4rem 1.8rem; background: linear-gradient(135deg, var(--navy), var(--violet)); }
.pay-head .btn-close { position: absolute; top: 1.2rem; right: 1.2rem; }
.pay-logo { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: #fff; padding: 4px; }
.receipt-brand { display: flex; gap: .8rem; align-items: center; padding: 1rem 1.3rem; border-bottom: 1px dashed #d7dbea; }
.receipt-brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; }
.receipt-brand strong { display: block; font-size: 1.05rem; }
.receipt-brand small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.35; }

/* Recognition card (shared) */
.recog { margin-top: -60px; position: relative; z-index: 5; }
.recog.recog-flat { margin-top: 0; }
.recog-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); padding: 1.8rem; }
.recog-flat .recog-card { box-shadow: var(--shadow); }
.recog-title { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.05rem; margin-bottom: 1.2rem; }
.recog-title i { color: var(--pink); font-size: 1.3rem; }
.recog-item { display: flex; gap: .9rem; align-items: flex-start; background: var(--bg); border-radius: 14px; padding: 1rem; height: 100%; }
.recog-icon { flex: 0 0 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; color: #fff; }
.recog-icon.i1 { background: linear-gradient(135deg, #2563eb, #1e40af); }
.recog-icon.i2 { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.recog-icon.i3 { background: linear-gradient(135deg, #16a34a, #15803d); }
.recog-item small { display: block; color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.recog-item .val { font-family: ui-monospace, monospace; font-weight: 700; color: var(--navy); word-break: break-all; font-size: .9rem; }
.recog-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.6rem; border-top: 1px dashed #e5e7eb; margin-top: 1.4rem; padding-top: 1.2rem; font-size: .93rem; }
.recog-contact span, .recog-contact a { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); text-decoration: none; }
.recog-contact a:hover { color: var(--pink); }
.recog-contact i { color: var(--violet); }

@media (max-width: 575px) {
    .recog { margin-top: -40px; }
    .recog-card { padding: 1.2rem; }
    .reg-kv, .reg-status-row { grid-template-columns: 1fr; }
    .page-hero { padding: 40px 0 100px; }
}

@media print {
    body.print-receipt * { visibility: hidden; }
    body.print-receipt #receiptPrint, body.print-receipt #receiptPrint * { visibility: visible; }
    body.print-receipt #receiptPrint { position: fixed; top: 20px; left: 20px; right: 20px; }
    body.print-receipt .ticket-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
