/* ============================================================
   Mzanzi Connect — web design system
   Palette ported from MobileInstance/Resources/Styles/Colors.xaml
   ============================================================ */

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/OpenSans-Regular.ttf') format('truetype');
    font-weight: 400 700;
    font-display: swap;
}

:root {
    --ink: #101014;
    --ink-soft: #1A1814;
    --sand: #F4F0E6;
    --sand-deep: #EDE8DA;
    --sand-line: #E6E2D6;
    --surface: #FFFFFF;
    --yellow: #FFD60A;
    --yellow-deep: #FFB400;
    --hot: #E8553C;
    --muted: #7C7C82;
    --muted-soft: #A4A199;
    --hairline: #F0ECDF;
    --success: #13A88B;
    --success-soft: #CDEDE2;
    --danger: #E8553C;
    --danger-soft: #FBE0DA;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--sand);
    color: var(--ink);
}

#app { min-height: 100vh; }

a { color: inherit; text-decoration: none; }

/* ── Loading screen (shown until Blazor boots) ───────────────── */
.loading-screen {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-deep) 45%, var(--hot) 100%);
    color: var(--ink);
    font-weight: 600;
}
.loading-spinner {
    width: 48px; height: 48px;
    border: 5px solid rgba(16,16,20,0.2);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 18px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Blazor error UI ─────────────────────────────────────────── */
#blazor-error-ui {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--ink); color: #fff;
    padding: 12px 20px; z-index: 1000;
    box-shadow: 0 -1px 8px rgba(0,0,0,0.3);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 12px; }
#blazor-error-ui .reload { color: var(--yellow); text-decoration: underline; }

/* ── Typography helpers ──────────────────────────────────────── */
.semibold { font-weight: 600; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 1.6px; color: var(--muted); text-transform: uppercase; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; border: none; cursor: pointer;
    font-family: inherit; font-weight: 600; font-size: 15px;
    border-radius: 14px; padding: 0 20px; height: 52px;
    transition: filter .15s, background-color .15s, transform .05s;
}
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--ink); color: var(--yellow); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.15); }
/* GhostButton (ported from Styles.xaml) */
.btn-ghost {
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--sand-line); font-size: 14px; height: 46px;
}
.btn-ghost:hover:not(:disabled) { background: var(--sand-deep); }

/* ── Form fields ─────────────────────────────────────────────── */
.field-label { font-size: 10px; font-weight: 600; letter-spacing: 1.6px; color: var(--muted); text-transform: uppercase; margin-bottom: 6px; display: block; }
.field {
    width: 100%; height: 48px;
    background: var(--sand); border: 1px solid var(--sand-line);
    border-radius: 12px; padding: 0 14px;
    font-family: inherit; font-size: 14px; color: var(--ink);
}
.field:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(16,16,20,0.06); }
.field::placeholder { color: var(--muted-soft); }

/* ── Cards / surfaces ────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--sand-line);
    border-radius: 22px; padding: 22px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.06);
}

/* ── Error banner ────────────────────────────────────────────── */
.error-banner {
    background: var(--danger-soft); border: 1px solid var(--hot);
    border-radius: 10px; padding: 10px 12px;
    color: #7A1F0E; font-weight: 600; font-size: 13px;
}

/* ── Pill / chip ─────────────────────────────────────────────── */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 999px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    background: transparent; color: var(--ink);
    border: 1px solid transparent;
}
.pill.active { background: var(--ink); color: var(--yellow); }

/* ── Brand gradient (login hero) ─────────────────────────────── */
.brand-gradient {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-deep) 45%, var(--hot) 100%);
}

/* ── Centered auth card (Register / Forgot / Validate) ───────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card .card { display: flex; flex-direction: column; gap: 16px; }
.auth-logo-row { display: flex; align-items: center; gap: 10px; }
.auth-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: var(--yellow); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 22px; }
.auth-title { font-size: 26px; font-weight: 600; letter-spacing: -0.4px; }
.auth-sub { font-size: 13px; color: var(--muted); }
.success-banner { background: var(--success-soft); border: 1px solid var(--success); border-radius: 10px; padding: 10px 12px; color: #0C5A48; font-weight: 600; font-size: 13px; }
.link-center { text-align: center; font-size: 13px; color: var(--muted); }
.link-strong { color: var(--ink); font-weight: 600; cursor: pointer; }
