/* ============================================================
   FamilyHub 360 — shared palette
   Keep these values in sync with:
     src/FamilyHub360.Mobile.Native/App/NativeColors.cs
   ============================================================ */
:root {
    --fh-ink: #24304A;
    --fh-muted: #66738F;

    --fh-primary: #4A68D1;
    --fh-primary-dark: #3955B8;
    --fh-primary-soft: #8CA9FF;
    --fh-primary-tint: #E8EEFF;

    --fh-secondary: #FFC857;
    --fh-cream: #FFF8E7;
    --fh-cream-strong: #FFF2C6;

    --fh-coral: #FFD9D1;
    --fh-coral-strong: #FF9A86;

    --fh-line: #DCE6FB;
    --fh-surface: #FFFDF6;
    --fh-white: #FFFFFF;

    --fh-success: #2F8C5A;
    --fh-success-soft: #DDF6E8;
    --fh-warning: #F2A93B;
    --fh-warning-soft: #FFF1D6;
    --fh-danger: #C24F42;
    --fh-danger-soft: #FBE4E1;

    --fh-shadow: 0 12px 28px rgba(36, 48, 74, 0.10);
}

html,
body {
    min-height: 100%;
    color: var(--fh-ink);
    font-family: "Nunito", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, var(--fh-cream) 0%, #FFFBF0 45%, var(--fh-primary-tint) 100%);
}

a,
.btn-link {
    color: var(--fh-primary);
}

a:hover {
    color: var(--fh-primary-dark);
}

.btn {
    border-radius: 10px;
    font-weight: 650;
}

.btn-primary {
    color: var(--fh-white);
    background: var(--fh-primary);
    border-color: var(--fh-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    color: var(--fh-white);
    background: var(--fh-primary-dark);
    border-color: var(--fh-primary-dark);
}

.btn-secondary {
    color: var(--fh-ink);
    background: var(--fh-secondary);
    border-color: #F2BC4A;
}

.btn-secondary:hover,
.btn-secondary:focus {
    color: var(--fh-ink);
    background: #FFBE40;
    border-color: #E8AC2E;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--fh-primary);
    box-shadow: 0 0 0 0.2rem rgba(74, 104, 209, 0.22);
}

.content {
    padding-top: 1.5rem;
}

h1,
h2,
h3 {
    letter-spacing: 0;
}

h1:focus {
    outline: none;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(1.65rem, 2.5vw, 2.35rem);
    font-weight: 760;
}

.eyebrow {
    margin: 0 0 0.2rem;
    color: var(--fh-primary-dark);
    font-size: 0.78rem;
    font-weight: 760;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fh-panel {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 253, 246, 0.92);
    border: 1px solid var(--fh-line);
    border-radius: 10px;
    box-shadow: var(--fh-shadow);
}

.context-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.context-strip article {
    display: grid;
    gap: 0.12rem;
    padding: 0.95rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--fh-line);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(36, 48, 74, 0.07);
}

.context-strip span {
    color: var(--fh-primary-dark);
    font-size: 0.76rem;
    font-weight: 760;
    text-transform: uppercase;
}

.context-strip strong {
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.context-strip small {
    overflow: hidden;
    color: var(--fh-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.module-grid article {
    padding: 1rem;
    background: linear-gradient(180deg, var(--fh-cream) 0%, var(--fh-cream-strong) 100%);
    border: 1px solid #F2E2B0;
    border-radius: 10px;
}

.module-grid span {
    display: block;
    color: var(--fh-muted);
    font-size: 0.85rem;
}

.module-grid strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.25rem;
}

.module-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.module-list a {
    display: grid;
    gap: 0.25rem;
    min-height: 86px;
    padding: 0.9rem;
    color: var(--fh-ink);
    text-decoration: none;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--fh-cream) 100%);
    border: 1px solid var(--fh-line);
    border-radius: 10px;
}

.module-list a:hover {
    border-color: var(--fh-primary-soft);
    box-shadow: 0 8px 20px rgba(140, 169, 255, 0.25);
}

.module-list span {
    font-weight: 760;
}

.module-list small {
    color: var(--fh-muted);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.settings-grid > div {
    padding: 1rem;
    background: #FFFFFF;
    border: 1px solid var(--fh-line);
    border-radius: 10px;
}

.settings-grid p {
    margin-bottom: 0;
    color: var(--fh-muted);
}

.form-label {
    color: #435179;
    font-size: 0.85rem;
    font-weight: 720;
}

.form-control,
.form-select {
    min-height: 2.65rem;
    color: var(--fh-ink);
    background-color: #FFFFFF;
    border-color: var(--fh-line);
    border-radius: 8px;
}

.context-note {
    margin-bottom: 1rem;
    padding: 0.8rem 0.9rem;
    color: var(--fh-muted);
    background: #FFFFFF;
    border: 1px solid var(--fh-line);
    border-radius: 8px;
}

.context-note strong {
    color: var(--fh-ink);
}

.table {
    color: var(--fh-ink);
}

.table thead th {
    color: var(--fh-primary-dark);
    background: var(--fh-cream);
    border-bottom-color: var(--fh-line);
}

.table td {
    border-color: var(--fh-primary-tint);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 760;
}

.status-pill.success {
    color: #1E5A3B;
    background: var(--fh-success-soft);
}

.status-pill.warning {
    color: #92600F;
    background: var(--fh-warning-soft);
}

.status-pill.danger {
    color: #8A352B;
    background: var(--fh-danger-soft);
}

.status-pill.info {
    color: var(--fh-primary-dark);
    background: var(--fh-primary-tint);
}

.outline-icon {
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 1.2rem;
    margin-right: 0.7rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state {
    display: grid;
    gap: 0.35rem;
    place-items: center;
    min-height: 170px;
    text-align: center;
    background: linear-gradient(180deg, var(--fh-cream) 0%, #FFFFFF 100%);
}

.empty-state span {
    color: var(--fh-muted);
}

.record-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 7px;
    background: var(--fh-primary-tint);
}

.record-icon .outline-icon {
    margin-right: 0;
}

.auth-shell {
    min-height: calc(100vh - 8rem);
    display: grid;
    place-items: center;
    padding: 2rem 0;
}

.auth-card {
    width: min(440px, 100%);
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--fh-line);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(36, 48, 74, 0.10);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
    text-align: left;
}

.auth-brand h1 {
    margin: 0;
    font-size: 1.8rem;
    letter-spacing: 0;
}

.auth-card .eyebrow {
    color: var(--fh-primary);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.auth-card .form-label {
    color: var(--fh-ink);
    font-size: 0.9rem;
    font-weight: 750;
}

.auth-card .form-control {
    min-height: 2.85rem;
    border: 1px solid #c8d5f1;
    border-radius: 12px;
    color: var(--fh-ink);
    background: #fff;
    box-shadow: none;
}

.auth-card .form-control:focus {
    border-color: var(--fh-primary);
    box-shadow: 0 0 0 0.18rem rgba(74, 104, 209, 0.14);
}

.auth-card .btn-primary {
    min-height: 2.9rem;
    border-radius: 12px;
}

.auth-link {
    display: block;
    margin-top: 1rem;
    text-align: center;
    font-weight: 700;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--fh-success);
}

.invalid {
    outline: 1px solid var(--fh-danger);
}

.validation-message {
    color: var(--fh-danger);
}

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: var(--fh-danger);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

@media (max-width: 760px) {
    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .context-strip {
        grid-template-columns: 1fr;
    }
}

/* Official Welcome home artwork, shared with the native application. */
.familyhub-wordmark { display: block; width: 210px; max-width: 100%; height: auto; object-fit: contain; background: #fff; border-radius: 8px; }
.familyhub-wordmark--login { width: 320px; }
.familyhub-wordmark--heading { width: 360px; }
.login-layout__brand { flex-wrap: wrap; }
@media (max-width: 640px) { .navbar-brand .familyhub-wordmark { width: 190px; } }
.familyhub-brand-icon { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: #fff; flex-shrink: 0; }
.hub-welcome{display:flex;justify-content:space-between;align-items:center;gap:24px;background:linear-gradient(115deg,#173a5e,#167ca5);color:white;border-radius:18px;padding:32px;margin-bottom:24px}
.hub-welcome h2{color:white;margin:10px 0}.hub-welcome p{margin-bottom:0;opacity:.86}
.hub-area-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:18px}
.hub-area-card{display:flex;flex-direction:column;text-decoration:none;color:#173a5e;border:1px solid #dae5ec;border-radius:16px;padding:24px;background:white;box-shadow:0 3px 12px #173a5e06}
.hub-area-card:hover{border-color:#167ca5;box-shadow:0 6px 20px #173a5e12}.hub-area-card h2{font-size:1.15rem;margin:16px 0 8px}.hub-area-card p{color:#627486;font-size:.95rem;flex:1}.hub-area-icon{display:grid;place-items:center;width:42px;height:42px;background:#eaf5fa;border-radius:12px}.hub-card-link{font-weight:650}
.hub-toolbar{display:flex;flex-wrap:wrap;gap:16px;align-items:end}.hub-toolbar label{min-width:180px;flex:1}.hub-actions{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.hub-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.hub-form-field{display:flex;flex-direction:column;gap:8px;min-width:0}.hub-form-field:has(textarea),.hub-form-field:has(.hub-line){grid-column:1/-1}
.hub-form-field label{font-weight:600}.hub-form-field small,.hub-confirmed{color:#627486;font-size:.85rem}.hub-confirmed{margin-top:20px}
.hub-line{display:flex;flex-wrap:wrap;gap:8px;border:1px solid #dce5ed;border-radius:10px;padding:12px}.hub-line .form-select,.hub-line .form-control{flex:1;min-width:140px}
.hub-check{display:flex;align-items:center;gap:10px;padding:6px 0}.hub-check input{width:18px;height:18px}
.hub-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:18px}.hub-fields dt{font-size:.8rem;color:#627486}.hub-fields dd{white-space:pre-wrap;overflow-wrap:anywhere}
.hub-detail,.hub-editor{margin-bottom:20px}.hub-table td{max-width:300px;overflow-wrap:anywhere;white-space:pre-wrap}.hub-table th{font-size:.8rem;color:#627486}.hub-empty{padding:24px 0;color:#627486}.fh-panel h2{font-size:1.2rem}.fh-panel{margin-bottom:20px}
@media(max-width:700px){.hub-welcome{display:block;padding:24px}.hub-welcome .btn{margin-top:20px}.hub-form-grid{grid-template-columns:1fr}.hub-toolbar label{width:100%}.hub-area-grid{grid-template-columns:1fr}.admin-context{flex-wrap:wrap}.top-row{height:auto!important;min-height:64px;padding-top:12px;padding-bottom:12px}.hub-actions .btn{flex-grow:1}}
.hub-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.hub-calendar>strong{text-align:center;font-size:.8rem;color:#627486}.hub-calendar-day{min-height:85px;padding:7px;border:1px solid #e0e8ee;border-radius:8px;min-width:0}.hub-calendar-day time{font-size:.8rem;color:#627486}.hub-calendar-event{display:block;width:100%;border:0;background:#e6f4fa;border-radius:5px;text-align:left;padding:5px;color:#175675;font-size:.78rem;overflow-wrap:anywhere}.hub-calendar-event:hover{background:#cceaf7}@media(max-width:700px){.hub-calendar-day{min-height:65px;padding:3px}.hub-calendar-event{font-size:.68rem;padding:2px}}
html[data-theme=dark]{color-scheme:dark}html[data-theme=dark] body{background:#111c29;color:#e4edf5}html[data-theme=dark] .fh-panel,html[data-theme=dark] .hub-area-card,html[data-theme=dark] .hub-editor{background:#1c2b3c;color:#e4edf5;border-color:#3a4e61}html[data-theme=dark] h1,html[data-theme=dark] h2{color:#e4edf5}html[data-theme=dark] .form-control,html[data-theme=dark] .form-select{background:#132333;color:#e4edf5;border-color:#486075}html[data-theme=dark] .table{--bs-table-bg:#1c2b3c;--bs-table-color:#e4edf5;--bs-table-border-color:#3a4e61}html[data-theme=dark] .hub-confirmed,html[data-theme=dark] .hub-area-card p,html[data-theme=dark] .hub-form-field small,html[data-theme=dark] .hub-fields dt{color:#b6c9d9}
.hub-day-button{border:0;background:transparent;padding:2px 5px;border-radius:4px}.hub-day-button:hover,.hub-day-button:focus-visible{background:#dceef7;outline:2px solid #167ca5}
#blazor-error-ui { display: none; }
