/* =====================================================================
   public.css — student-facing pages (form + success).
   No framework. Mobile-first. Colours come from a small inline
   :root block each page prints from config/site.php.
   Fallbacks below let the file work even if that block is missing.
   ===================================================================== */

:root {
    --brand: #c0392b;
    --brand-dark: #96271b;
    --heading: #1a3e6f;
    --bg: #f4f7f6;
    --ink: #333;
    --muted: #7a8894;
    --line: #e6ecea;
    --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 14px 40px; }

/* ---- Card + header --------------------------------------------------- */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .07);
    overflow: hidden;
    animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.brandhead { text-align: center; padding: 26px 20px 18px; }
.brandhead img { width: 96px; height: auto; display: block; margin: 0 auto 10px; }
.brandhead h1 { font-size: 1.15rem; color: var(--heading); margin: 0 0 2px; line-height: 1.25; }
.brandhead p { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 600; }

/* ---- Body + sections ------------------------------------------------- */
.body { padding: 8px 20px 24px; }

.section {
    font-size: .72rem; letter-spacing: 1px; text-transform: uppercase;
    color: var(--brand); font-weight: 800;
    border-bottom: 2px solid var(--line); padding-bottom: 6px; margin: 24px 0 14px;
}

.required {
    background: #fff6f5; border: 1px solid #f3d3ce;
    border-radius: 12px; padding: 16px; margin-bottom: 4px;
}
.required h2 { font-size: .95rem; color: var(--brand-dark); margin: 0 0 12px; }

/* ---- Form controls --------------------------------------------------- */
label { display: block; font-size: .85rem; font-weight: 600; color: #444; margin: 0 0 5px; }
.opt { color: var(--muted); font-weight: 400; font-style: italic; font-size: .78rem; }
.req { color: var(--brand); }

.field { margin-bottom: 14px; }
input, select, textarea {
    width: 100%; padding: 12px 13px; font-size: 16px; /* 16px stops iOS zoom */
    border: 1px solid #dfe6e4; border-radius: 10px; background: #fafafa;
    color: var(--ink); font-family: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand); background: #fff;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}
textarea { resize: vertical; }

.row2 { display: flex; gap: 12px; }
.row2 > * { flex: 1; }
@media (max-width: 430px) { .row2 { flex-direction: column; gap: 0; } }

/* ---- Buttons --------------------------------------------------------- */
.btn {
    display: block; width: 100%; text-align: center;
    padding: 14px; font-size: 1.02rem; font-weight: 700;
    border: none; border-radius: 11px; cursor: pointer;
    background: var(--brand); color: #fff; text-decoration: none;
    transition: transform .12s, box-shadow .12s, background .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.99); }
.btn:disabled { background: #c9d2d0; cursor: not-allowed; }
.btn-dark { background: #1a1d21; }
.btn-dark:hover { background: #000; }

/* ---- Alerts (used for duplicate / missing on the form) --------------- */
.alert { border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; font-size: .9rem; }
.alert h3 { margin: 0 0 4px; font-size: .98rem; }
.alert-warn { background: #fff8e6; border: 1px solid #f5e2a8; color: #7a5b00; }
.alert-info { background: #eef7ff; border: 1px solid #cfe6fb; color: #1a4e7a; }
.alert .call { display: inline-block; margin-top: 8px; margin-right: 8px; font-weight: 700; color: var(--brand-dark); text-decoration: none; }

/* ---- Success + payment ---------------------------------------------- */
.hero {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff; text-align: center; padding: 34px 20px 30px;
}
.hero .cap { font-size: 2.6rem; line-height: 1; }
.hero h1 { margin: 8px 0 8px; font-size: 1.3rem; }
.badge {
    display: inline-block; background: rgba(255, 255, 255, .18);
    padding: 5px 14px; border-radius: 20px; font-size: .8rem; font-weight: 600;
}

.pay {
    display: flex; align-items: center; gap: 12px;
    border: 2px solid var(--line); border-radius: 12px; padding: 14px;
    margin-bottom: 12px; width: 100%; text-align: left; background: #fff;
    cursor: pointer; font: inherit; color: inherit;
    transition: border-color .15s, background .15s, transform .12s;
}
.pay:hover { border-color: var(--brand); background: #fff6f5; }
.pay .ic { font-size: 1.7rem; }
.pay .t { font-weight: 700; }
.pay .s { font-size: .8rem; color: var(--muted); }
.pay .tag { margin-left: auto; font-size: .78rem; font-weight: 700; color: #12a150; }

details.paybox { border: 2px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
details.paybox[open] { border-color: var(--brand); }
details.paybox > summary { list-style: none; }
details.paybox > summary::-webkit-details-marker { display: none; }
.panel { padding: 6px 16px 18px; border-top: 1px solid var(--line); }

/* Detected mobile-money network badge */
#net { display: none; margin-top: 8px; padding: 6px 12px; border-radius: 8px; font-size: .82rem; font-weight: 700; }
.n-tigo { background: #0055a4; color: #fff; }
.n-airtel { background: #e40000; color: #fff; }
.n-halotel { background: #ff6600; color: #fff; }
.n-bad { background: #ffe4e4; color: #b00020; border: 1px solid #ffb3b3; }

.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.center { text-align: center; }

.foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 22px 10px 0; }
.foot a { color: var(--heading); text-decoration: none; font-weight: 600; }
