@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ══════════════════════════════════════════════
   AusTriathlon Volunteer Portal — Design System
   ══════════════════════════════════════════════ */

:root {
    /* Brand palette — derived from AusTriathlon logo gradient */
    --brand-navy: #0b1d3a;
    --brand-navy-light: #122a52;
    --brand-blue: #007DFF;
    --brand-blue-light: #4da3ff;
    --brand-blue-muted: #e8f2ff;
    --brand-purple: #6b3fa0;
    --brand-magenta: #b83280;
    --brand-orange: #e8721c;
    --brand-gradient: linear-gradient(135deg, #007DFF 0%, #6b3fa0 40%, #b83280 70%, #e8721c 100%);

    /* Neutrals */
    --surface: #f4f6f9;
    --surface-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Semantic */
    --success: #059669;
    --success-bg: #ecfdf5;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
    --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 4px 6px rgba(15,23,42,.04), 0 2px 4px rgba(15,23,42,.06);
    --shadow-lg: 0 10px 25px rgba(15,23,42,.08), 0 4px 10px rgba(15,23,42,.04);
    --shadow-xl: 0 20px 50px rgba(15,23,42,.12), 0 8px 20px rgba(15,23,42,.06);

    /* Radii */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-pill: 9999px;

    /* Motion */
    --ease: cubic-bezier(.4, 0, .2, 1);
    --duration: 200ms;

    /* Typography */
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ────────────────────── */
html {
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--surface);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1:focus { outline: none; }

a {
    color: var(--brand-blue);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}
a:hover { color: var(--brand-navy); }

::selection {
    background: var(--brand-blue-muted);
    color: var(--brand-navy);
}

/* ── Buttons ─────────────────────────── */
.btn-primary {
    color: #fff;
    background: var(--brand-blue);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}
.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,.12) 100%);
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}
.btn-primary:hover, .btn-primary:active {
    background: #0066dd;
    border-color: #0066dd;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,125,255,.35);
}
.btn-primary:hover::before { opacity: 1; }

.btn-outline-primary {
    color: var(--brand-blue);
    border: 1.5px solid var(--brand-blue);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 600;
    background: transparent;
}
.btn-outline-primary:hover {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
    box-shadow: 0 4px 14px rgba(0,125,255,.25);
}

.btn:focus-visible, .form-control:focus, .form-check-input:focus, .form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,125,255,.2);
    border-color: var(--brand-blue);
}
.btn-link.nav-link:focus { box-shadow: none; }

/* ── Forms ────────────────────────────── */
.form-control, .form-select {
    font-family: var(--font);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.875rem;
    font-size: 0.925rem;
    transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.form-control:hover, .form-select:hover {
    border-color: #cbd5e1;
}
.form-floating > label {
    color: var(--text-muted);
    font-size: 0.925rem;
}

.valid.modified:not([type=checkbox]) { outline: none; border-color: var(--success); }
.invalid { outline: none; border-color: var(--danger); }
.validation-message { color: var(--danger); font-size: 0.82rem; margin-top: 0.25rem; }

/* ── Cards ────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

/* ── Badges & Tables ─────────────────── */
.badge { font-weight: 600; letter-spacing: 0.01em; }

.table { --bs-table-hover-bg: var(--brand-blue-muted); }
.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ══════════════════════════════════════════════
   Identity pages — Auth screens
   ══════════════════════════════════════════════ */

.identity-page {
    background: var(--brand-navy);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Animated ambient orbs for depth */
.identity-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.identity-bg__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    will-change: transform;
}
.identity-bg__orb--1 {
    width: 600px; height: 600px;
    background: var(--brand-blue);
    top: -200px; right: -100px;
    animation: orb-drift 20s ease-in-out infinite alternate;
}
.identity-bg__orb--2 {
    width: 500px; height: 500px;
    background: var(--brand-purple);
    bottom: -150px; left: -100px;
    animation: orb-drift 25s ease-in-out infinite alternate-reverse;
}
.identity-bg__orb--3 {
    width: 350px; height: 350px;
    background: var(--brand-orange);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    animation: orb-drift 18s ease-in-out infinite alternate;
}

@keyframes orb-drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(30px, -20px) scale(1.05); }
    100% { transform: translate(-20px, 30px) scale(0.95); }
}

/* Shell — centers and constrains the card */
.identity-shell {
    width: 100%;
    max-width: 480px;
    padding: 4rem 1.25rem 2rem;
    position: relative;
    z-index: 1;
    margin: auto;
}
.identity-shell.identity-wide {
    max-width: 680px;
}

/* Brand header */
.identity-brand {
    text-align: center;
    margin-bottom: 2.5rem;
}
.identity-brand a {
    display: inline-block;
    text-decoration: none;
}
.identity-brand img {
    height: 44px;
    display: block;
    margin: 0 auto;
}
.identity-brand__badge {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.3rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Card */
.identity-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    padding: 2.75rem 2.5rem;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.05);
    position: relative;
}
/* Gradient accent bar on top of card */
.identity-card::before {
    content: '';
    position: absolute;
    top: 0; left: 2rem; right: 2rem;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--brand-gradient);
}

.identity-card h1 {
    font-size: 1.65rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.identity-card .identity-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Overrides for form elements inside card */
.identity-card .form-floating { margin-bottom: 0; }
.identity-card .form-control, .identity-card .form-select {
    background: var(--surface);
    border-color: var(--border);
}
.identity-card .form-control:focus, .identity-card .form-select:focus {
    background: #fff;
}

.identity-card .btn-lg {
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    font-size: 1rem;
}

.identity-card .form-check-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.identity-links {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.identity-links a {
    font-weight: 600;
    margin: 0 0.35rem;
}

/* Section dividers inside forms */
.section-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-heading:first-of-type { margin-top: 0.25rem; }
.section-heading::before {
    content: '';
    width: 3px;
    height: 12px;
    border-radius: 2px;
    background: var(--brand-gradient);
    flex-shrink: 0;
}

/* Status icons for confirmation pages */
.status-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.75rem;
}
.status-icon.success { background: var(--success-bg); color: var(--success); }
.status-icon.warning { background: var(--warning-bg); color: var(--warning); }
.status-icon.danger  { background: var(--danger-bg); color: var(--danger); }

.identity-footer {
    text-align: center;
    margin-top: 2.5rem;
    color: rgba(255,255,255,.35);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════
   Blazor app shell — Sidebar layout
   ══════════════════════════════════════════════ */

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .page { flex-direction: row; }
}

.sidebar {
    background: var(--brand-navy);
    color: rgba(255,255,255,.85);
}

.sidebar .top-row {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,.06);
    justify-content: center;
}

.sidebar .navbar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #fff;
}

.sidebar .nav-item .nav-link {
    color: rgba(255,255,255,.6);
    border-radius: var(--radius-sm);
    margin: 2px 10px;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--duration) var(--ease);
}
.sidebar .nav-item .nav-link:hover {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.95);
}
.sidebar .nav-item .nav-link.active {
    background: rgba(0,125,255,.2);
    color: #fff;
    font-weight: 600;
}
.sidebar .nav-item .nav-link.active .oi {
    color: var(--brand-blue-light);
}

main .top-row {
    background: var(--surface-card);
    border-bottom: 1px solid var(--border);
    justify-content: flex-end;
    gap: 1.25rem;
    font-size: 0.875rem;
}
.header-title {
    margin-right: auto;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-navy);
    letter-spacing: -0.02em;
}
main .top-row a, main .top-row .btn-link {
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}
main .top-row a:hover { color: var(--brand-blue); }
main .top-row .btn-link { padding: 0; border: none; }

.content {
    padding-top: 1.5rem;
}
.content h1 {
    font-size: 1.75rem;
    color: var(--brand-navy);
    margin-bottom: 0.25rem;
}
.content .lead {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* ── Manage pages — pill navigation ──── */
.manage-nav .nav-pills {
    gap: 0.35rem;
}
.manage-nav .nav-pills .nav-link {
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    padding: 0.4rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
    border: 1.5px solid transparent;
}
.manage-nav .nav-pills .nav-link:hover {
    background: var(--brand-blue-muted);
    color: var(--brand-blue);
    border-color: var(--brand-blue-muted);
}
.manage-nav .nav-pills .nav-link.active {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
    box-shadow: 0 2px 8px rgba(0,125,255,.25);
}

/* ── Alerts ───────────────────────────── */
.alert {
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

/* ══════════════════════════════════════════════
   Dashboard
   ══════════════════════════════════════════════ */

.dash-header {
    margin-bottom: 1.75rem;
}
.dash-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.15rem;
}
.dash-header .lead {
    margin-bottom: 0;
}

/* Stat row */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.dash-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.dash-stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.dash-stat__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.dash-stat__icon--shifts {
    background: rgba(0, 125, 255, .08);
    color: var(--brand-blue);
}
.dash-stat__icon--pending {
    background: rgba(217, 119, 6, .08);
    color: var(--warning);
}
.dash-stat__icon--events {
    background: rgba(5, 150, 105, .08);
    color: var(--success);
}
.dash-stat__icon--hours {
    background: rgba(107, 63, 160, .08);
    color: var(--brand-purple);
}

.dash-stat__body {
    display: flex;
    flex-direction: column;
}
.dash-stat__value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}
.dash-stat__label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

/* Empty state */
.dash-empty {
    text-align: center;
    padding: 2rem 1rem;
}
.dash-empty__icon {
    font-size: 2rem;
    color: var(--text-muted);
    opacity: .4;
    display: block;
    margin-bottom: 0.75rem;
}
.dash-empty p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ── Safeguarding gate overlay ────────── */
.safeguarding-overlay {
    min-height: 100vh;
    background: var(--surface);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
}

/* ── Error UI ─────────────────────────── */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }
