/* ============================================================
   K-STAR Portal styles — brand-aligned with the main site.
   ============================================================ */
:root {
  --bg: #ffffff;
  --bg-light: #f7f7fb;
  --text: #111111;
  --text-2: #555555;
  --muted: #8a8a99;
  --accent: #a855f7;
  --accent-2: #3b82f6;
  --gradient: linear-gradient(135deg, #a855f7, #3b82f6);
  /* Apply-page gold (from brand brief) */
  --gold: #d9a521;
  --gold-dark: #c8941a;
  --gold-gradient: linear-gradient(135deg, #e3b23a, #c8941a);
  --gold-ink: #2b2206;
  --border: #e7e7ef;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(17, 17, 17, 0.08);
  --shadow-lg: 0 20px 50px rgba(17, 17, 17, 0.14);
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---- Top bar ---- */
.portal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.6rem;
  background: #0d0d12;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.portal-nav .brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}
.portal-nav .brand span { color: var(--accent); }
.portal-nav .nav-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.portal-nav a.nav-link { color: rgba(255,255,255,0.8); font-size: 0.9rem; padding: 0.4rem 0.8rem; border-radius: 8px; }
.portal-nav a.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }

/* ---- Main-site navbar tweaks (public pages use the real index navbar) ---- */
/* Highlight the active portal menu item in the shared K-Culture navbar. */
.navbar .nav-item.active-link { color: var(--accent); font-weight: 700; }

/* ---- Layout shells ---- */
/* Public pages use the main site's FIXED navbar, so offset content below it. */
.wrap { max-width: 980px; margin: 0 auto; padding: 7rem 1.2rem 4rem; }
.wrap-wide { max-width: 1240px; margin: 0 auto; padding: 2rem 1.2rem 4rem; }

/* ---- Hero / page header ---- */
.page-head { text-align: center; margin-bottom: 2.5rem; }
.page-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; margin: 0 0 0.6rem; }
.page-head p { color: var(--text-2); max-width: 620px; margin: 0 auto; }

/* ---- Cards ---- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem;
  margin-bottom: 1.4rem;
}
.card h2.section-h {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-ink);
  background: var(--gold-gradient);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin: -0.2rem 0 1.4rem;
  font-weight: 800;
}

/* ---- Forms ---- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.4rem; }
@media (max-width: 680px) { .grid-2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; margin-bottom: 0.2rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.4rem; color: var(--text); }
.field label .req { color: var(--danger); }
.field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 0.3rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="date"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow, rgba(168,85,247,0.15));
}
textarea { resize: vertical; min-height: 90px; }

/* checkbox grids */
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.2rem; }
@media (max-width: 680px) { .check-grid { grid-template-columns: 1fr; } }
.check {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.7rem; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; background: #fff;
  font-size: 0.92rem;
}
.check:hover { border-color: var(--accent); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.notice {
  border-radius: 10px; padding: 0.9rem 1.1rem; font-size: 0.9rem;
  border: 1px solid; margin: 1rem 0;
}
.notice.info { background: #eef6ff; border-color: #cfe3ff; color: #1d4ed8; }
.notice.warn { background: #fff8ec; border-color: #ffe3b0; color: #92600a; }
.notice.green { background: #ecfdf3; border-color: #b7f0cd; color: #157347; }
.notice.danger { background: #fdecea; border-color: #f5c2c0; color: #b42318; }
.notice strong { display: block; margin-bottom: 0.2rem; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.8rem 1.5rem; border: none; border-radius: 10px;
  font-family: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 6px 18px rgba(168,85,247,0.35); }
.btn-dark { background: #0d0d12; color: #fff; }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ---- Flash ---- */
.flash { border-radius: 10px; padding: 0.85rem 1.1rem; margin-bottom: 1.2rem; font-size: 0.92rem; font-weight: 500; }
.flash.success { background: #ecfdf3; color: #157347; border: 1px solid #b7f0cd; }
.flash.error { background: #fdecea; color: #b42318; border: 1px solid #f5c2c0; }
.flash.info { background: #eef6ff; color: #1d4ed8; border: 1px solid #cfe3ff; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td { padding: 0.75rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data thead th { background: #faf9ff; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
table.data tbody tr:hover { background: #faf9ff; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; }
.badge.pending { background: #fff4e5; color: #b45309; }
.badge.qualified { background: #e7f7ee; color: #157347; }
.badge.rejected { background: #fdecea; color: #b42318; }
.badge.rank { background: #f1eafe; color: #7c3aed; }
.badge.notified { background: #e8f0ff; color: #1d4ed8; }
.badge.paid { background: #e8f0ff; color: #1d4ed8; }

/* ---- Stats ---- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
@media (max-width: 760px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.stat .n { font-size: 1.8rem; font-weight: 800; }
.stat .l { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Toolbar ---- */
.toolbar { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tabs a { padding: 0.45rem 0.9rem; border-radius: 999px; font-size: 0.85rem; color: var(--text-2); border: 1px solid var(--border); background: #fff; }
.tabs a.active { background: var(--gradient); color: #fff; border-color: transparent; }

/* ---- Detail view ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem 2rem; }
@media (max-width: 680px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-grid .row { display: flex; flex-direction: column; padding: 0.55rem 0; border-bottom: 1px dashed var(--border); }
.detail-grid .row .k { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.detail-grid .row .v { font-size: 0.98rem; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip { background: #f1eafe; color: #7c3aed; border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.8rem; }

/* ---- Status result ---- */
.result-card { text-align: center; padding: 2.5rem 1.6rem; }
.result-card .big-icon { font-size: 3.2rem; }
.result-card h2 { font-size: 1.8rem; margin: 0.6rem 0; }
.pay-box { text-align: left; max-width: 460px; margin: 1.5rem auto 0; }
.pay-box .line { display: flex; justify-content: space-between; padding: 0.55rem 0; border-bottom: 1px dashed var(--border); }
.pay-box .line .k { color: var(--muted); }
.pay-box .line .v { font-weight: 700; }

.footer-note { text-align: center; color: var(--muted); font-size: 0.82rem; margin-top: 2rem; }

hr.sep { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
