/* Applicant profile portal. Uses the same visual language as the public school website. */

* { box-sizing: border-box; }
body.portal-profile-page {
    margin: 0;
    min-height: 100vh;
    background: var(--school-bg);
    color: var(--school-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.hidden { display: none !important; }

.portal-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: calc(var(--school-header-height) + 34px) 0 56px;
}

/* Initial auth resolution state prevents the old/login screen from flashing before Firebase resolves. */
.portal-boot-state {
    min-height: 52vh;
    display: grid;
    place-items: center;
}
.portal-boot-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px 20px;
    border: 1px solid var(--school-line);
    border-radius: 15px;
    background: #fff;
    box-shadow: var(--school-shadow);
    color: var(--school-text);
}
.portal-boot-card strong { display: block; color: var(--school-ink); font-size: 13px; }
.portal-boot-card span { display: block; margin-top: 2px; color: var(--school-muted); font-size: 11px; }

.spinner {
    width: 28px;
    height: 28px;
    flex: none;
    border: 3px solid #dfeaf3;
    border-top-color: var(--school-primary);
    border-radius: 50%;
    animation: portalSpin .78s linear infinite;
}
@keyframes portalSpin { to { transform: rotate(360deg); } }

/* Login gate */
.auth-gate {
    min-height: calc(100vh - var(--school-header-height) - 100px);
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, .72fr);
    gap: 24px;
    align-items: stretch;
}
.auth-illustration {
    position: relative;
    min-height: 500px;
    overflow: hidden;
    border-radius: 22px;
    background:
        linear-gradient(0deg, rgba(6,34,59,.82), rgba(6,34,59,.08) 70%),
        url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgRWgkcpNlx6d5Z2wf17TWI_9p2lGAnaeE6YdFoPBSlfVvhnBxxyNjcxugCqUEwqrEYbHyqZFdSboKGZC3QP7cidBEpVoFOHRGZPhgbxN_7T41Xz7Ui_1ApTUFCD9TPznKlhh4-8EW_mZmOVR-r60CHGcsYExgFm88NHMPdh8Dxr5g_7jZisdjXRlauOyk/w640-h360/IMG_2570.JPG') center/cover no-repeat;
    box-shadow: var(--school-shadow);
}
.auth-illustration::after {
    content: "Profil pendaftaran dalam satu halaman yang rapi.";
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 30px;
    max-width: 530px;
    color: #fff;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.04;
    font-weight: 850;
    letter-spacing: -.04em;
}
.mini-school,
.shape { display: none; }
.auth-card {
    align-self: center;
    padding: 32px;
    border: 1px solid var(--school-line);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--school-shadow);
}
.eyebrow,
.panel-kicker {
    display: inline-block;
    color: var(--school-primary);
    font-size: 10.5px;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.eyebrow.light { color: rgba(255,255,255,.8); }
.auth-card h1 {
    margin: 9px 0 12px;
    color: var(--school-ink);
    font-size: clamp(28px, 3.5vw, 40px);
    line-height: 1.08;
    font-weight: 850;
    letter-spacing: -.035em;
}
.auth-card > p { margin: 0 0 24px; color: var(--school-text); line-height: 1.68; }
.auth-form { display: grid; gap: 14px; }
.auth-form label,
.modal-card label { display: grid; gap: 7px; color: #4d5b70; font-size: 12.5px; font-weight: 750; }
.auth-form input,
.modal-card input,
.registration-selector {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d8e1e9;
    border-radius: 11px;
    background: #fff;
    padding: 10px 13px;
    outline: 0;
    color: var(--school-ink);
    font: inherit;
}
.auth-form input:focus,
.modal-card input:focus,
.registration-selector:focus { border-color: #86b7da; box-shadow: 0 0 0 4px rgba(15,95,159,.09); }
.primary-button,
.google-button {
    min-height: 46px;
    border-radius: 11px;
    padding: 11px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.primary-button { background: var(--school-primary); color: #fff; box-shadow: 0 9px 20px rgba(15,95,159,.16); }
.primary-button:hover { background: var(--school-primary-dark); }
.google-button { width: 100%; margin-top: 11px; color: #445269; background: #fff; border: 1px solid var(--school-line); }
.google-button:hover { background: #f8fafc; }
.text-button { margin: 12px auto 0; display: block; border: 0; background: transparent; color: var(--school-primary); font-weight: 750; cursor: pointer; }
.auth-footnote { margin-top: 15px; text-align: center; color: var(--school-muted); font-size: 12px; }
.auth-footnote a { color: var(--school-primary); font-weight: 800; }
.message-box { margin-bottom: 14px; padding: 11px 13px; border: 1px solid #ffd1d1; border-radius: 11px; background: #fff1f1; color: #a63d3d; font-size: 12px; }

/* Dashboard */
.dashboard { display: grid; gap: 18px; min-width: 0; }
.welcome-banner {
    position: relative;
    min-width: 0;
    min-height: 188px;
    overflow: hidden;
    padding: 30px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 88% 16%, rgba(255,255,255,.15) 0 85px, transparent 86px),
        linear-gradient(125deg, #0a4779, #0f5f9f 58%, #2a77b0);
    color: #fff;
    box-shadow: 0 18px 42px rgba(15,95,159,.17);
}
.welcome-banner > * { position: relative; z-index: 1; }
.welcome-banner h1 {
    margin: 7px 0 6px;
    color: #fff;
    font-size: clamp(31px, 4.2vw, 50px);
    line-height: 1.02;
    font-weight: 850;
    letter-spacing: -.045em;
}
.welcome-banner p { max-width: 700px; margin: 0; color: rgba(255,255,255,.82); font-size: 13px; line-height: 1.6; }
.welcome-badge-wrap { display: grid; justify-items: end; gap: 8px; }
.soft-badge,
.id-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--school-primary-soft);
    color: var(--school-primary-dark);
    font-size: 10.5px;
    font-weight: 800;
    white-space: nowrap;
}
.welcome-banner .soft-badge,
.sync-text {
    background: rgba(255,255,255,.94);
    color: #32516c;
    border: 1px solid rgba(255,255,255,.9);
}
.sync-text { min-height: 31px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; }
.sync-text i { color: var(--school-primary); }
.welcome-logout-btn {
    min-height: 38px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 10px;
    background: rgba(10,36,59,.24);
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}
.welcome-logout-btn:hover { background: rgba(10,36,59,.38); }

.loading-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid var(--school-line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23,42,68,.05);
}
.loading-card div:last-child { display: grid; gap: 2px; }
.loading-card strong { color: var(--school-ink); font-size: 13px; }
.loading-card span { color: var(--school-muted); font-size: 11px; }

.dashboard-grid { display: grid; gap: 18px; min-width: 0; }
.top-grid { grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); }
.detail-grid { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); margin-top: 18px; }
.panel {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--school-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(23,42,68,.06);
}
.panel-heading { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-heading h2 { margin: 4px 0 0; color: var(--school-ink); font-size: 19px; font-weight: 820; letter-spacing: -.02em; }
.icon-button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: none;
    border: 1px solid var(--school-line);
    border-radius: 10px;
    background: #fff;
    color: var(--school-primary);
    cursor: pointer;
}
.icon-button:hover { background: var(--school-primary-soft); }
.profile-identity { display: flex; align-items: center; gap: 13px; padding-bottom: 17px; border-bottom: 1px solid var(--school-line); }
.profile-avatar { width: 58px; height: 58px; flex: none; object-fit: cover; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #dce6ee; }
.profile-identity h3 { margin: 0; color: var(--school-ink); font-size: 16px; font-weight: 820; }
.profile-identity p { margin: 3px 0 0; color: var(--school-muted); font-size: 11px; overflow-wrap: anywhere; }
.mini-detail-list { margin: 0; }
.mini-detail-list > div { padding: 11px 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px dashed #e7ecf1; }
.mini-detail-list dt { color: var(--school-muted); font-size: 10.5px; }
.mini-detail-list dd { margin: 0; color: var(--school-ink); font-size: 11px; font-weight: 800; text-align: right; }
.status-dot { width: 7px; height: 7px; display: inline-block; margin-right: 5px; border-radius: 50%; background: #34a853; }
.privacy-note { margin: 15px 0 0; padding: 11px; display: flex; gap: 8px; border-radius: 11px; background: #f7f9fc; color: var(--school-muted); font-size: 10.5px; line-height: 1.5; }
.privacy-note i { margin-top: 2px; color: var(--school-primary); }

.registration-selector { max-width: 260px; min-height: 38px; padding-block: 7px; font-size: 11px; }
.status-summary {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 18px;
    align-items: start;
    padding: 17px;
    border: 1px solid #e3ebf2;
    border-radius: 14px;
    background: #f8fafc;
}
.status-summary h3 { margin: 0; color: var(--school-ink); font-size: 17px; font-weight: 820; }
.status-summary p { margin: 6px 0 0; color: var(--school-muted); font-size: 11px; line-height: 1.55; }
.current-status { max-width: 190px; padding: 8px 10px; border-radius: 10px; font-size: 10.5px; font-weight: 850; text-align: center; }
.status-new { background: #eaf4fb; color: #0a4779; }
.status-verified { background: #fff4d8; color: #8b5a00; }
.status-success { background: #e9f7ee; color: #20733c; }
.status-danger { background: #fff0f0; color: #a83d3d; }

.progress-track { margin-top: 20px; display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); }
.progress-step { position: relative; min-width: 0; padding: 0 4px; text-align: center; }
.progress-step::before { content: ""; position: absolute; left: calc(50% + 16px); right: calc(-50% + 16px); top: 16px; height: 2px; background: #e2e8ee; }
.progress-step:last-child::before { display: none; }
.progress-step.completed::before { background: #75afd6; }
.progress-node {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    margin: 0 auto 8px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #edf2f6;
    color: #8895a7;
    font-size: 11px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #dde5ec;
}
.progress-step.completed .progress-node { background: #2e78ae; color: #fff; box-shadow: 0 0 0 1px #2e78ae; }
.progress-step.current .progress-node { background: var(--school-accent); color: #172033; box-shadow: 0 0 0 4px rgba(243,165,26,.14); }
.progress-step strong { display: block; color: var(--school-ink); font-size: 9.5px; font-weight: 820; line-height: 1.25; }
.progress-step span { display: block; margin-top: 3px; color: var(--school-muted); font-size: 8.5px; line-height: 1.25; }

.empty-registration { margin-top: 18px; padding: 38px 22px; text-align: center; border: 1px solid var(--school-line); border-radius: 18px; background: #fff; box-shadow: 0 10px 28px rgba(23,42,68,.06); }
.empty-icon { width: 66px; height: 66px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 18px; background: var(--school-accent-soft); color: #b66e08; font-size: 27px; }
.empty-registration h2 { margin: 0 0 7px; color: var(--school-ink); font-size: 21px; font-weight: 820; }
.empty-registration p { max-width: 650px; margin: 0 auto 17px; color: var(--school-muted); font-size: 12px; line-height: 1.6; }
.inline-button { width: fit-content; margin: 0 auto; }

.id-badge { background: var(--school-accent-soft); color: #9b6109; }
.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
.detail-row { min-width: 0; padding: 11px 0; border-bottom: 1px dashed #e7ecf1; }
.detail-row.full { grid-column: 1 / -1; }
.detail-row span { display: block; color: var(--school-muted); font-size: 9.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.detail-row strong { display: block; margin-top: 4px; color: var(--school-ink); font-size: 12px; font-weight: 780; overflow-wrap: anywhere; }
.edit-warning { margin-top: 16px; padding: 12px; display: flex; gap: 8px; border-radius: 11px; background: #f7f9fc; color: var(--school-muted); font-size: 10.5px; line-height: 1.55; }
.edit-warning i { margin-top: 2px; color: var(--school-primary); }

.document-list { display: grid; gap: 9px; }
.document-item { min-width: 0; padding: 11px; display: flex; align-items: center; gap: 11px; border: 1px solid #e9edf2; border-radius: 12px; background: #fafbfd; }
.document-icon { width: 39px; height: 39px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--school-primary-soft); color: var(--school-primary); }
.document-copy { min-width: 0; flex: 1; }
.document-copy strong { display: block; color: var(--school-ink); font-size: 11px; font-weight: 820; }
.document-copy span { display: block; margin-top: 2px; color: var(--school-muted); font-size: 9.5px; }
.document-action { flex: none; padding: 6px 8px; border-radius: 8px; background: var(--school-primary-soft); color: var(--school-primary-dark); text-decoration: none; font-size: 10px; font-weight: 820; }
.document-action.disabled { pointer-events: none; background: #eef1f4; color: #929cab; }
.whatsapp-button { margin-top: 14px; padding: 11px 13px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; background: #20a66a; color: #fff; text-decoration: none; font-size: 12px; font-weight: 800; }

.info-panel { margin-top: 18px; }
.panel-link { color: var(--school-primary); text-decoration: none; font-size: 10.5px; font-weight: 800; }
.schedule-list { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.schedule-item { min-height: 102px; padding: 14px; overflow: hidden; position: relative; border: 1px solid #e9edf2; border-radius: 13px; background: #fafbfd; }
.schedule-item::after { content: ""; position: absolute; right: -18px; bottom: -22px; width: 58px; height: 58px; border-radius: 50%; background: var(--schedule-color,#eaf4fb); opacity: .75; }
.schedule-item i { color: var(--school-primary); }
.schedule-item strong { display: block; margin-top: 10px; color: var(--school-ink); font-size: 11px; font-weight: 820; }
.schedule-item span { display: block; margin-top: 4px; color: var(--school-muted); font-size: 9.5px; line-height: 1.35; }

/* Edit profile modal */
.profile-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,25,42,.45); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(440px,100%); padding: 26px; border: 1px solid var(--school-line); border-radius: 18px; background: #fff; box-shadow: 0 30px 80px rgba(8,25,42,.22); }
.modal-card h2 { margin: 6px 0 8px; color: var(--school-ink); font-size: 23px; font-weight: 820; }
.modal-card p { margin: 0 0 17px; color: var(--school-muted); font-size: 11px; line-height: 1.55; }
.modal-card form { display: grid; gap: 14px; }
.modal-close { position: absolute; top: 13px; right: 13px; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--school-line); border-radius: 50%; background: #fff; color: #66758a; cursor: pointer; }
.modal-close:hover { color: #b53c3c; background: #fff3f3; }

footer.portal-footer.school-shared-footer { margin-top: 0 !important; }

@media (max-width: 980px) {
    .auth-gate { grid-template-columns: 1fr; }
    .auth-illustration { display: none; }
    .auth-card { width: min(560px,100%); margin: 4vh auto; }
    .top-grid,
    .detail-grid { grid-template-columns: 1fr; }
    .schedule-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 767px) {
    .portal-shell { width: calc(100% - 24px); padding-top: calc(var(--school-header-height) + 20px); padding-bottom: 42px; }
    .auth-gate { min-height: auto; }
    .auth-card { margin: 0; padding: 22px 19px; border-radius: 17px; }
    .welcome-banner { min-height: 210px; padding: 22px; align-items: flex-start; flex-direction: column; border-radius: 18px; }
    .welcome-badge-wrap { justify-items: start; }
    .panel { padding: 18px; border-radius: 15px; }
    .progress-heading { flex-direction: column; align-items: stretch; }
    .registration-selector { max-width: none; }
    .status-summary { grid-template-columns: 1fr; }
    .current-status { max-width: none; width: fit-content; }
    .progress-track { grid-template-columns: 1fr; gap: 0; }
    .progress-step { min-height: 58px; display: grid; grid-template-columns: 36px 1fr; gap: 8px; align-items: start; text-align: left; padding: 0; }
    .progress-step::before { left: 16px; right: auto; top: 33px; bottom: -1px; width: 2px; height: auto; }
    .progress-node { margin: 0; }
    .progress-step strong,
    .progress-step span { grid-column: 2; }
    .progress-step strong { margin-top: 5px; }
    .progress-step span { margin-top: -23px; padding-top: 23px; }
    .detail-list { grid-template-columns: 1fr; }
    .detail-row.full { grid-column: auto; }
    .schedule-list { grid-template-columns: 1fr; }
    .panel-heading { gap: 8px; }
    .panel-link { display: none; }
}

@media (max-width: 430px) {
    .portal-shell { width: calc(100% - 18px); }
    .welcome-banner { padding: 19px; }
    .welcome-banner h1 { font-size: 33px; }
    .panel { padding: 16px; }
    .profile-identity { align-items: flex-start; }
    .mini-detail-list > div { align-items: flex-start; flex-direction: column; gap: 3px; }
    .mini-detail-list dd { text-align: left; }
    .document-item { align-items: flex-start; flex-wrap: wrap; }
    .document-action { margin-left: 50px; }
}
