@import url("icons.css");
@font-face { font-family: "Moonty"; src: url("fonts/Moonty.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("fonts/InterTight-Regular.ttf"); font-weight: 400; }
@font-face { font-family: "Inter Tight"; src: url("fonts/InterTight-SemiBold.ttf"); font-weight: 600; }
@font-face { font-family: "Inter Tight"; src: url("fonts/InterTight-ExtraBold.ttf"); font-weight: 800; }

/* Brand colours come from the API (GET /config) and are set on :root by app.js; these are only the fallbacks. */
:root {
  --primary: #263A59; --primary-light: #5278B8; --primary-soft: #E8EEF8; --accent: #F2A541; --on-primary: #FFFFFF;
  --bg: #F5F6FA; --surface: #FFFFFF; --muted: #EEF0F5; --text: #1B2233; --text-2: #657089; --text-3: #9AA3B6;
  --border: #E5E8EF; --success: #1F8A61; --success-soft: #E3F3EC; --error: #D14950; --error-soft: #FBE9EA; --warning: #C47F0E; --warning-soft: #FCF2DF;
  --shadow: 0 1px 2px rgba(20, 30, 50, .04), 0 8px 28px rgba(20, 30, 50, .06);
  --r-sm: 10px; --r-md: 12px; --r-lg: 18px; --r-xl: 26px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --primary-soft: #232C42; --bg: #0E1320; --surface: #161D2D; --muted: #212A3D; --text: #E8ECF4; --text-2: #98A3B8; --text-3: #667189;
  --border: #263046; --success: #4CC395; --success-soft: #16352A; --error: #F0767C; --error-soft: #3A1E24; --warning: #E6AE4E; --warning-soft: #3A2E17; --shadow: none;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Inter Tight", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary-light); text-decoration: none; } a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.muted { color: var(--text-2); } .small { font-size: 13px; }
[class^="ri-"] { font-size: 1.15em; line-height: 1; vertical-align: -0.15em; }

/* brand mark */
.wordmark { font-family: "Moonty", "Inter Tight", sans-serif; font-size: 24px; line-height: 1; color: var(--primary); display: inline-flex; align-items: center; letter-spacing: -.2px; }
.wordmark img { height: 30px; display: block; }
.brandline { display: flex; align-items: center; gap: 12px; }
.brandline .tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 9px; border-radius: 99px; background: var(--primary-soft); color: var(--primary-light); }

/* loading, toast, motion */
.dots { display: inline-flex; gap: 6px; padding: 40px; justify-content: center; width: 100%; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--primary-light); animation: dot 1.1s infinite ease-in-out; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1.08); } }
.view > * { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.view > *:nth-child(2) { animation-delay: .05s; } .view > *:nth-child(3) { animation-delay: .1s; } .view > *:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
#toast > div { background: var(--text); color: var(--surface); padding: 11px 18px; border-radius: 99px; box-shadow: 0 8px 30px rgba(0,0,0,.25); display: flex; gap: 8px; align-items: center; font-weight: 600; animation: pop .2s ease-out; }
#toast > .error { background: var(--error); color: #fff; }

/* buttons & fields */
.btn { border: 1px solid transparent; background: var(--primary); color: var(--on-primary); border-radius: var(--r-md); padding: 10px 18px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: transform .12s, filter .12s, background .12s; }
.btn:hover { filter: brightness(1.07); } .btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border); } .btn.secondary:hover { background: var(--muted); filter: none; }
.btn.ghost { background: none; color: var(--primary-light); padding: 8px 12px; }
.btn.danger { background: var(--error); color: #fff; }
.btn.small { padding: 7px 13px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn.block { width: 100%; padding: 13px 18px; font-size: 16px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 13.5px; } .field small { font-weight: 400; color: var(--text-2); font-size: 12.5px; }
.field .err { color: var(--error); font-weight: 600; font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--muted); border: 1.5px solid transparent; border-radius: var(--r-md); padding: 11px 13px; font-weight: 400; font-size: 15px; transition: border-color .12s, background .12s; }
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-light); background: var(--surface); outline: none; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .stack { display: grid; gap: 14px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--border); background: var(--surface); border-radius: 99px; padding: 7px 14px; font-weight: 600; font-size: 13.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: all .12s; }
.chip:hover { border-color: var(--primary-light); } .chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip.lvl-warning[aria-pressed="true"] { background: #E59A1F; border-color: #E59A1F; color: #fff; } .chip.lvl-danger[aria-pressed="true"] { background: var(--error); border-color: var(--error); color: #fff; }

/* cards & badges */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 24px; box-shadow: var(--shadow); }
.card > h2, .card-head h2 { font-size: 17px; margin-bottom: 16px; display: flex; gap: 9px; align-items: center; } .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; } .card-head h2 { margin: 0; }
.badge { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--muted); color: var(--text-2); }
.badge.success { background: var(--success-soft); color: var(--success); } .badge.warning { background: var(--warning-soft); color: var(--warning); } .badge.critical { background: var(--error-soft); color: var(--error); } .badge.primary { background: var(--primary-soft); color: var(--primary-light); }
.empty { text-align: center; color: var(--text-2); padding: 36px 16px; display: grid; gap: 8px; justify-items: center; } .empty [class^="ri-"] { font-size: 34px; color: var(--text-3); }

/* ----------------------------------------------------------- auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 560px); }
.auth .hero { background: var(--primary); color: var(--on-primary); padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; position: relative; overflow: hidden; }
.auth .hero::before { content: ""; position: absolute; width: 720px; height: 720px; right: -240px; top: -220px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.22), rgba(255,255,255,0) 65%); }
.auth .hero::after { content: ""; position: absolute; width: 520px; height: 520px; left: -200px; bottom: -240px; border-radius: 50%; background: var(--accent); opacity: .28; filter: blur(30px); }
.auth .hero > * { position: relative; z-index: 1; }
.auth .hero .wordmark { color: var(--on-primary); font-size: 30px; } .auth .hero .wordmark img { height: 38px; }
.auth .hero h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.035em; max-width: 560px; margin-bottom: 16px; }
.auth .hero p { opacity: .85; max-width: 480px; margin: 0; font-size: 17px; }
.auth .benefits { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.auth .benefits li { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,.12); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-lg); padding: 14px 16px; animation: rise .5s both; }
.auth .benefits li:nth-child(2) { animation-delay: .08s; } .auth .benefits li:nth-child(3) { animation-delay: .16s; }
.auth .benefits [class^="ri-"] { font-size: 22px; margin-top: 1px; } .auth .benefits b { display: block; } .auth .benefits span { opacity: .8; font-size: 14px; }
.auth .pane { display: grid; align-content: center; padding: clamp(24px, 4vw, 56px); gap: 22px; max-height: 100vh; overflow: auto; }
.auth .pane h2 { font-size: 28px; } .auth .pane .tools { display: flex; justify-content: flex-end; gap: 6px; }
.auth form { display: grid; gap: 16px; } .auth .switch { text-align: center; color: var(--text-2); }
.auth .switch button { background: none; border: 0; color: var(--primary-light); font-weight: 700; cursor: pointer; padding: 0; }
.section-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.alert { padding: 12px 14px; border-radius: var(--r-md); background: var(--error-soft); color: var(--error); font-weight: 600; display: flex; gap: 8px; }
.alert.info { background: var(--primary-soft); color: var(--primary-light); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .hero { padding-bottom: 28px; } .auth .benefits { display: none; } .auth .pane { max-height: none; } }

/* status page (application pending / declined) */
.status-wrap { max-width: 640px; margin: 8vh auto; padding: 0 20px; display: grid; gap: 20px; }
.steps { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding-bottom: 20px; position: relative; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 2px; width: 2px; background: var(--border); }
.steps .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); color: var(--text-3); }
.steps .done .dot { background: var(--success-soft); color: var(--success); } .steps .now .dot { background: var(--primary); color: var(--on-primary); animation: breathe 2s infinite; }
.steps b { display: block; } .steps span { color: var(--text-2); font-size: 14px; }

/* ----------------------------------------------------------- shell */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 18px; }
.top .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; } .who .name { font-weight: 700; line-height: 1.15; } .who .sub { font-size: 12.5px; color: var(--text-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-light); display: grid; place-items: center; font-weight: 800; overflow: hidden; flex: none; } .avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 84px; height: 84px; font-size: 28px; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.icon-btn { background: none; border: 0; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; color: var(--text-2); display: grid; place-items: center; font-size: 19px; } .icon-btn:hover { background: var(--muted); color: var(--text); }
.tabs { max-width: 1160px; margin: 0 auto; padding: 0 24px 12px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 9px 16px; border-radius: 99px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background .12s, color .12s; }
.tab:hover { background: var(--muted); color: var(--text); } .tab[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.tab .n { background: var(--error); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.main { max-width: 1160px; margin: 0 auto; padding: 28px 24px 80px; }
.view { display: grid; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; } .page-head h1 { font-size: 30px; } .page-head p { margin: 4px 0 0; color: var(--text-2); }
@media (max-width: 640px) { .top-in { padding: 10px 16px; } .tabs, .main { padding-left: 16px; padding-right: 16px; } .who .meta { display: none; } }

/* overview */
.greet { border: 0; color: var(--on-primary); background: linear-gradient(120deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, var(--accent)) 130%); position: relative; overflow: hidden; padding: 30px; }
.greet::after { content: ""; position: absolute; width: 380px; height: 380px; right: -80px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 68%); }
.greet > * { position: relative; z-index: 1; } .greet h1 { font-size: 30px; margin: 4px 0 6px; } .greet p { margin: 0; opacity: .85; }
.greet .area { display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.18); border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: 13px; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.quick .btn { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); color: var(--on-primary); backdrop-filter: blur(4px); } .quick .btn:hover { background: rgba(255,255,255,.28); filter: none; }
.quick .btn.alarm { background: var(--error); border-color: transparent; color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.kpi { display: flex; gap: 14px; align-items: center; padding: 20px; } .kpi .tile { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-size: 23px; background: var(--primary-soft); color: var(--primary-light); flex: none; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; } .kpi .l { color: var(--text-2); font-size: 13.5px; }
.kpi.t2 .tile { background: var(--success-soft); color: var(--success); } .kpi.t3 .tile { background: var(--warning-soft); color: var(--warning); } .kpi.t4 .tile { background: var(--error-soft); color: var(--error); }
.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; } @media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding-top: 10px; }
.bar { flex: 1; display: grid; gap: 6px; justify-items: center; align-content: end; height: 100%; font-size: 12px; color: var(--text-2); }
.bar i { display: block; width: 100%; max-width: 46px; background: linear-gradient(var(--primary-light), var(--primary)); border-radius: 10px 10px 4px 4px; min-height: 4px; transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.bar b { color: var(--text); font-size: 13px; }
.list { display: grid; } .list > * { padding: 14px 0; border-bottom: 1px solid var(--border); } .list > *:last-child { border-bottom: 0; padding-bottom: 0; }
.row { display: flex; gap: 14px; align-items: flex-start; } .row .grow { flex: 1; min-width: 0; } .row .grow p { margin: 2px 0 0; overflow-wrap: anywhere; }
.meta { color: var(--text-2); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* alert composer + live preview */
.compose { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 22px; align-items: start; } @media (max-width: 980px) { .compose { grid-template-columns: 1fr; } }
.phone { background: var(--muted); border-radius: 34px; padding: 18px 14px; border: 1px solid var(--border); position: sticky; top: 130px; }
.phone .screen { background: var(--surface); border-radius: 22px; min-height: 360px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; gap: 10px; box-shadow: var(--shadow); overflow: hidden; }
.phone .ghost { display: grid; gap: 9px; } .phone .ghost i { display: block; height: 11px; border-radius: 6px; background: var(--muted); } .phone .ghost i:nth-child(3n) { width: 62%; } .phone .ghost .img { height: 90px; border-radius: 14px; }
.phone .nav { display: flex; justify-content: space-around; border-top: 1px solid var(--border); padding-top: 10px; color: var(--text-3); font-size: 20px; }
.banner { border-radius: 16px; color: #fff; padding: 12px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: pop .25s both; }
.banner [class^="ri-"] { font-size: 26px; animation: breathe 1.6s infinite; } .banner small { display: block; opacity: .8; letter-spacing: .08em; font-weight: 800; font-size: 10.5px; text-transform: uppercase; } .banner b { line-height: 1.2; display: block; }
.lvl-info { background: var(--primary-light); } .lvl-warning { background: #E59A1F; } .lvl-danger { background: var(--error); }

/* post / event items */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; } .thumbs .th { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; position: relative; background: var(--muted); } .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .th button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 13px; }
.post-img { display: flex; gap: 6px; margin-top: 8px; } .post-img img { height: 74px; width: 74px; object-fit: cover; border-radius: 10px; }
.cover { width: 96px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--muted); flex: none; display: grid; place-items: center; color: var(--text-3); font-size: 24px; }
.drop { border: 2px dashed var(--border); border-radius: var(--r-lg); padding: 18px; text-align: center; color: var(--text-2); cursor: pointer; display: grid; gap: 4px; justify-items: center; transition: border-color .12s, background .12s; } .drop:hover { border-color: var(--primary-light); background: var(--primary-soft); }
.drop input { display: none; }

/* dialog */
.overlay { position: fixed; inset: 0; background: rgba(10, 15, 30, .5); backdrop-filter: blur(3px); z-index: 40; display: grid; place-items: center; padding: 20px; animation: pop .15s both; }
.dialog { background: var(--surface); border-radius: var(--r-xl); padding: 26px; width: min(440px, 100%); display: grid; gap: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.35); } .dialog h3 { font-size: 19px; } .dialog p { margin: 0; color: var(--text-2); } .dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.profile-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.codebox { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 800; }

.wordmark.on-hero { background: #fff; padding: 9px 16px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18); color: var(--primary); }
.auth .hero .wordmark.on-hero { color: var(--primary); }
.auth .hero .tag { background: rgba(255,255,255,.2); color: var(--on-primary); }

/* custom dropdown */
.dd { position: relative; } .dd-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--muted); border: 1.5px solid transparent; border-radius: var(--r-md); padding: 11px 13px; font-weight: 400; font-size: 15px; cursor: pointer; text-align: left; transition: border-color .12s, background .12s; }
.dd-btn:hover { background: var(--border); } .dd-btn[aria-expanded="true"], .dd-btn:focus-visible { border-color: var(--primary-light); background: var(--surface); outline: none; }
.dd-btn .ph { color: var(--text-3); } .dd-btn [class^="ri-"] { color: var(--text-2); transition: transform .15s; } .dd-btn[aria-expanded="true"] [class^="ri-"] { transform: rotate(180deg); }
.dd-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: 0 18px 50px rgba(15, 20, 40, .22); padding: 6px; animation: pop .12s both; }
.dd-sw { display: flex; align-items: center; gap: 8px; background: var(--muted); border-radius: var(--r-sm); padding: 0 10px; margin-bottom: 6px; color: var(--text-2); } .dd-sw input { background: none !important; border: 0 !important; padding: 9px 0 !important; outline: none; }
.dd-list { max-height: 260px; overflow: auto; display: grid; gap: 1px; }
.dd-group { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; }
.dd-opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; font-weight: 400; } .dd-opt.act { background: var(--muted); } .dd-opt.sel { font-weight: 700; color: var(--primary-light); }
.dd-empty { padding: 14px; text-align: center; color: var(--text-2); font-weight: 400; }
::placeholder { color: var(--text-3); opacity: 1; }
