/* ============================================================
   CPC Groups — medical-blue, split-view, mobile-first stylesheet
   ============================================================ */

:root {
    --blue-800: #14306e;
    --blue-700: #1e40af;
    --blue-600: #1d4ed8;   /* primary */
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --sky:      #0ea5e9;
    --navy:     #0d1b46;

    --accent-2:  #f59e0b;
    --danger:    #dc2626;
    --danger-bg: #fef2f2;
    --ok:        #16a34a;
    --ok-bg:     #f0fdf4;

    --ink-900:   #0f172a;
    --ink-700:   #334155;
    --ink-500:   #64748b;
    --ink-300:   #cbd5e1;
    --line:      #e6eaf2;
    --surface:   #ffffff;
    --bg:        #eef2fb;

    --radius:    18px;
    --radius-sm: 11px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --shadow-lg: 0 18px 40px rgba(29, 78, 216, .16), 0 6px 14px rgba(15, 23, 42, .08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink-900);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   SPLIT LAYOUT
   ============================================================ */
.split {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ---- Brand (left) panel ---- */
.split__brand {
    position: relative;
    flex: 0 0 46%;
    max-width: 620px;
    padding: 48px 52px;
    display: flex;
    flex-direction: column;
    color: #fff;
    overflow: hidden;
    background:
        radial-gradient(1100px 500px at 115% -10%, rgba(14, 165, 233, .45), transparent 60%),
        radial-gradient(700px 420px at -10% 115%, rgba(96, 165, 250, .35), transparent 55%),
        linear-gradient(160deg, var(--blue-600) 0%, var(--blue-700) 48%, var(--navy) 100%);
}
/* faint medical pattern dots */
.split__brand::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.10) 1.5px, transparent 1.6px);
    background-size: 26px 26px;
    opacity: .5;
    pointer-events: none;
}
.brand-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.brand-top img { height: 44px; width: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); }
.brand-top .bt-name { font-weight: 800; font-size: 1.15rem; letter-spacing: .2px; }

.brand-mid { position: relative; z-index: 2; margin: auto 0; padding: 28px 0; }
.brand-mid h1 { font-size: 2.1rem; font-weight: 800; line-height: 1.15; margin: 0 0 12px; }
.brand-mid p.lead { font-size: 1rem; opacity: .9; margin: 0 0 26px; max-width: 30ch; }

.brand-illustration { width: 100%; max-width: 420px; }
.brand-illustration svg { width: 100%; height: auto; display: block; }

.brand-feats { position: relative; z-index: 2; display: grid; gap: 12px; margin-top: 26px; }
.brand-feats .feat { display: flex; align-items: center; gap: 12px; font-size: .92rem; font-weight: 500; }
.brand-feats .feat i {
    flex: 0 0 34px; height: 34px; display: grid; place-items: center;
    border-radius: 9px; background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.22); font-size: .9rem;
}

.brand-bottom { position: relative; z-index: 2; margin-top: 28px; font-size: .8rem; opacity: .8; }
.brand-bottom a { color: #fff; font-weight: 600; }

/* ---- Form (right) panel ---- */
.split__form {
    flex: 1 1 auto;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 24px;
    overflow-y: auto;
}
.formwrap { width: 100%; max-width: 420px; margin: auto 0; }

.form-head { margin-bottom: 22px; }
.form-head h2 { margin: 0; font-size: 1.55rem; font-weight: 800; color: var(--ink-900); }
.form-head p { margin: 6px 0 0; color: var(--ink-500); font-size: .95rem; }

/* mobile compact brand header (hidden on desktop) */
.mhead { display: none; }

/* ============================================================
   COMPONENTS
   ============================================================ */

/* notices */
.notice {
    display: flex; gap: 10px; align-items: flex-start;
    border-radius: var(--radius-sm); padding: 11px 14px;
    font-size: .86rem; font-weight: 500; margin: 0 0 16px;
    border: 1px solid transparent;
}
.notice i { margin-top: 2px; }
.notice-info  { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.notice-warn  { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.notice-error { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.notice-ok    { background: var(--ok-bg); color: #166534; border-color: #bbf7d0; }

/* form fields */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.input-wrap { position: relative; }
.input-wrap > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-500); pointer-events: none; }
.input {
    width: 100%; height: 52px; padding: 0 14px 0 44px;
    font-size: 1rem; font-family: inherit; color: var(--ink-900);
    background: #f8fafc; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s, background .15s; outline: none;
}
.input:focus {
    border-color: var(--blue-500); background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .18);
}

/* buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 52px; padding: 0 20px;
    font-size: 1rem; font-weight: 700; font-family: inherit;
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    transition: transform .08s, box-shadow .15s, opacity .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    box-shadow: 0 8px 18px rgba(29, 78, 216, .32);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(29, 78, 216, .42); color: #fff; }
.btn-ghost { color: var(--blue-700); background: #fff; border: 1.5px solid var(--line); }
.btn-ghost:hover { background: #f8fafc; color: var(--blue-700); }

/* quick links */
.links { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.links h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-500); margin: 0 0 12px; font-weight: 700; }
.link-row {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    margin-bottom: 9px; color: var(--ink-900); font-weight: 600; font-size: .9rem;
    transition: border-color .15s, transform .1s, box-shadow .15s;
}
.link-row:hover { text-decoration: none; border-color: var(--blue-400); transform: translateX(2px); box-shadow: var(--shadow-sm); }
.link-row .ic {
    flex: 0 0 38px; height: 38px; display: grid; place-items: center;
    border-radius: 9px; color: #fff; font-size: 1rem;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
}
.link-row .meta { flex: 1; min-width: 0; }
.link-row .meta small { display: block; font-weight: 500; color: var(--ink-500); font-size: .78rem; }
.link-row .chev { color: var(--ink-300); }
.badge-new { background: var(--accent-2); color: #fff; font-size: .62rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* status pill */
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.pill-ok  { background: var(--ok-bg); color: #166534; }
.pill-ok::before { background: var(--ok); }
.pill-exp { background: var(--danger-bg); color: var(--danger); }
.pill-exp::before { background: var(--danger); }

/* dashboard key/value rows */
.kv { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-500); font-size: .85rem; font-weight: 600; }
.kv .v { color: var(--ink-900); font-weight: 700; font-size: .92rem; }

.panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 8px 20px; box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}

/* ============================================================
   LEGACY component classes (kept for setup.php)
   ============================================================ */
.app-bg {
    width: 100%; min-height: 100vh; display: flex; flex-direction: column; align-items: center;
    background:
        radial-gradient(1100px 500px at 10% -10%, rgba(96,165,250,.35), transparent 60%),
        linear-gradient(160deg, var(--blue-600), var(--blue-700) 55%, var(--navy));
}
.shell { width: 100%; max-width: 480px; margin: auto; padding: 24px 18px 40px; }
.shell-wide { max-width: 760px; }
.brand { text-align: center; color: #fff; margin: 8px 0 22px; }
.brand img { height: 56px; margin-bottom: 10px; }
.brand h1 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.brand p { margin: 4px 0 0; opacity: .85; font-size: .9rem; font-weight: 500; overflow-wrap: break-word; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.card-pad { padding: 26px 24px; }
.card-head { padding: 22px 24px 18px; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); color: #fff; }
.card-head h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.card-head p { margin: 4px 0 0; font-size: .88rem; opacity: .9; }
.foot { text-align: center; color: rgba(255,255,255,.78); font-size: .78rem; padding: 18px 0 6px; }
.foot a { color: #fff; font-weight: 600; }

/* ============================================================
   RESPONSIVE  — collapse split to stacked on small screens
   ============================================================ */
@media (max-width: 900px) {
    .split { flex-direction: column; min-height: 0; }
    .split__brand { display: none; }           /* replaced by compact mobile header */
    .split__form { min-height: 0; padding: 0 0 36px; align-items: stretch; }
    .formwrap { max-width: 460px; padding: 0 20px; }

    .mhead {
        display: block; position: relative; overflow: hidden;
        padding: 26px 22px 30px; margin-bottom: 26px; color: #fff;
        border-radius: 0 0 24px 24px;
        background:
            radial-gradient(600px 300px at 110% -20%, rgba(14,165,233,.5), transparent 60%),
            linear-gradient(150deg, var(--blue-600), var(--blue-700) 60%, var(--navy));
    }
    .mhead::before {
        content: ''; position: absolute; inset: 0;
        background-image: radial-gradient(rgba(255,255,255,.10) 1.5px, transparent 1.6px);
        background-size: 24px 24px; opacity: .5;
    }
    .mhead-row { position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; }
    .mhead-row img { height: 38px; }
    .mhead-row .mh-name { font-weight: 800; font-size: 1.05rem; }
    .mhead h1 { position: relative; z-index: 2; margin: 16px 0 4px; font-size: 1.4rem; font-weight: 800; }
    .mhead p { position: relative; z-index: 2; margin: 0; font-size: .85rem; opacity: .9; }
}

@media (min-width: 901px) {
    .split__brand { position: sticky; top: 0; height: 100vh; }
}

@media (max-width: 380px) {
    .formwrap { padding: 0 16px; }
    .form-head h2 { font-size: 1.35rem; }
}
