/* portal.css - Shared styles for ECODEC Applicant Portal */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --navy: #1a2a5e; --red: #c0272d; --gold: #c8960c; --gold-light: #e8b84b;
  --white: #fff; --off: #f4f3f0; --text: #1c1c1c; --muted: #5a5a5a; --border: #ddd;
}
body { font-family: 'Source Sans 3', sans-serif; color: var(--text); font-size: 14px; }

/* ── AUTH PAGES ── */
.auth-page { background: linear-gradient(135deg, var(--navy) 0%, #0d1a3e 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border-radius: 5px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.auth-top { background: var(--navy); padding: 30px; text-align: center; border-bottom: 3px solid var(--gold); }
.auth-logo { width: 65px; margin-bottom: 14px; border-radius: 2px; }
.auth-top h2 { font-family: 'EB Garamond', serif; color: #fff; font-size: 1.3rem; margin-bottom: 5px; }
.auth-top p { color: rgba(255,255,255,.55); font-size: .78rem; line-height: 1.5; }
.auth-body { padding: 26px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .2px; color: #333; margin-bottom: 5px; }
.field label .req { color: var(--red); }
.field input { width: 100%; border: 1.5px solid var(--border); border-radius: 3px; padding: 9px 12px; font-family: inherit; font-size: .9rem; transition: border-color .2s; }
.field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,42,94,.1); }
.field input.err { border-color: var(--red); background: #fff8f8; }
.ferr { display: block; font-size: .72rem; color: var(--red); margin-top: 3px; }
.btn-auth { display: block; width: 100%; background: var(--navy); color: #fff; border: none; padding: 12px; font-family: inherit; font-size: .92rem; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; border-radius: 3px; cursor: pointer; margin-top: 6px; transition: background .2s; }
.btn-auth:hover { background: #0f1f4a; }
.auth-switch { text-align: center; margin-top: 16px; font-size: .8rem; color: var(--muted); }
.auth-switch a { color: var(--navy); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.alert-box { padding: 10px 14px; border-radius: 3px; font-size: .82rem; margin-bottom: 14px; }
.alert-err { background: #ffebee; border-left: 4px solid var(--red); color: #7f1d1d; }
.alert-ok  { background: #e8f5e9; border-left: 4px solid #2e7d32; color: #1b5e20; }

/* ── PORTAL PAGES ── */
.portal-page { background: var(--off); min-height: 100vh; }
.portal-header { background: var(--navy); border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.ph-inner { max-width: 1100px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 14px; }
.ph-logo { width: 44px; flex-shrink: 0; border-radius: 2px; }
.ph-title span { font-family: 'EB Garamond', serif; color: #fff; font-size: 1rem; font-weight: 600; display: block; line-height: 1.2; }
.ph-title small { font-size: .65rem; color: var(--gold-light); text-transform: uppercase; letter-spacing: .7px; }
.ph-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pnl { color: rgba(255,255,255,.7); text-decoration: none; font-size: .8rem; font-weight: 500; padding: 6px 12px; border-radius: 3px; transition: all .2s; position: relative; }
.pnl:hover { background: rgba(255,255,255,.1); color: #fff; }
.pnl.active { background: rgba(200,150,12,.15); color: var(--gold-light); }
.pnl-logout { background: rgba(192,39,45,.25); color: #ffaaaa; }
.pnl-logout:hover { background: rgba(192,39,45,.45); color: #fff; }
.nbadge { background: var(--red); color: #fff; font-size: .6rem; font-weight: 700; padding: 1px 5px; border-radius: 100px; position: absolute; top: 2px; right: 2px; }
.pnl.has-badge { padding-right: 18px; }

.portal-wrap { max-width: 960px; margin: 0 auto; padding: 28px 20px 60px; }

.welcome-banner { background: #e8f5e9; border: 1px solid #a5d6a7; border-left: 4px solid #2e7d32; border-radius: 4px; padding: 14px 18px; margin-bottom: 22px; font-size: .88rem; color: #1b5e20; }

.dash-greeting { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.dash-greeting h2 { font-family: 'EB Garamond', serif; font-size: 1.5rem; color: var(--navy); }
.dash-greeting p { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.btn-apply { background: var(--navy); color: #fff; padding: 9px 20px; border-radius: 3px; text-decoration: none; font-size: .85rem; font-weight: 600; transition: background .2s; }
.btn-apply:hover { background: #0f1f4a; }

.dash-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.ds { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 16px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.ds-num { font-size: 2rem; font-weight: 700; color: var(--navy); line-height: 1; }
.ds-lbl { font-size: .72rem; color: var(--muted); margin-top: 5px; text-transform: uppercase; letter-spacing: .3px; }

.dash-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.05); margin-bottom: 20px; overflow: hidden; }
.dc-head { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: #fafaf8; }
.dc-head h3 { font-family: 'EB Garamond', serif; font-size: .98rem; color: var(--navy); }
.dc-action { font-size: .8rem; font-weight: 600; color: var(--navy); text-decoration: none; }
.dc-action:hover { text-decoration: underline; }
.dc-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: .88rem; }

.app-list { padding: 6px 0; }
.app-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #f5f5f5; flex-wrap: wrap; }
.app-row:last-child { border-bottom: none; }
.app-row:hover { background: #fafaf8; }
.app-ref code { font-size: .78rem; background: #f5f5f5; padding: 3px 8px; border-radius: 3px; letter-spacing: .5px; }
.app-date { font-size: .72rem; color: var(--muted); display: block; margin-top: 3px; }
.app-prog { flex: 1; font-size: .85rem; font-weight: 600; color: var(--text); min-width: 150px; }
.app-meta { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); }
.app-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ab-view { background: #e8eaf6; color: var(--navy); padding: 5px 12px; border-radius: 3px; font-size: .78rem; font-weight: 700; text-decoration: none; }
.ab-view:hover { background: #d1d5f5; }

.notif-list { padding: 0; }
.notif-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #f5f5f5; position: relative; }
.notif-row:last-child { border-bottom: none; }
.notif-unread { background: #fafbff; }
.notif-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.notif-content { flex: 1; }
.notif-title { font-weight: 600; font-size: .88rem; color: var(--text); margin-bottom: 3px; }
.notif-msg { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.notif-time { font-size: .72rem; color: #aaa; margin-top: 4px; }
.notif-dot { width: 8px; height: 8px; background: var(--red); border-radius: 50%; flex-shrink: 0; margin-top: 6px; }

@media (max-width: 600px) {
  .ph-nav { display: none; }
  .app-row { flex-direction: column; align-items: flex-start; }
  .app-actions { margin-left: 0; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
}
