/* Shared foundation for typography, forms, buttons, feedback messages, and responsive behavior. */
* {
    box-sizing: border-box;
}

:root {
    --brand-primary: #6557a5;
    --brand-primary-dark: #514684;
    --brand-primary-subtle: #eeeaf7;
    --brand-secondary: #4e9d83;
}

[hidden] {
    display: none !important;
}

/* The application identity remains distinct from partner attribution and theme colors. */
/* Fixed dimensions also bound the first paint, before the deferred page shell is built. */
.app-logo {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.application-logo-link {
    display: block;
    width: 88px;
    height: 77px;
    margin: 0 auto 20px;
    border-radius: 10px;
}

/* Public entry pages use the larger mark without relying on an unconstrained parent. */
.application-logo-link > .app-logo {
    width: 88px;
    height: 77px;
}

.application-logo-link:focus-visible {
    outline: 3px solid #6557a5;
    outline-offset: 5px;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    color: #172033;
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(72, 162, 207, 0.22),
            transparent 36rem
        ),
        linear-gradient(145deg, #f7fbfd, #e4eef5);
}

select {
    min-width: 92px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #bdcad6;
    border-radius: 8px;
    color: #172033;
    background: #fff;
    font: inherit;
}

select option:disabled {
    color: #a3acb8;
    background: #eef1f4;
}

select:focus {
    border-color: var(--brand-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(8, 127, 175, 0.13);
}

.secondary-button {
    width: auto;
    height: 42px;
    padding: 0 16px;
    color: var(--brand-primary-dark);
    background: var(--brand-primary-subtle);
}

.secondary-button:hover {
    background: #dbeaf2;
}

.eyebrow {
    display: block;
    margin-bottom: 10px;
    color: var(--brand-primary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 2%;
}

h1 {
    margin: 0 0 12px;
    color: var(--brand-primary-dark);
    font-size: 34px;
}

.search-form {
    display: grid;
    gap: 22px;
}

.form-group {
    display: grid;
    gap: 8px;
}

label {
    color: #26364d;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid #bdcad6;
    border-radius: 10px;
    outline: none;
    color: #172033;
    background-color: #ffffff;
    font-size: 16px;
}

input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(8, 127, 175, 0.13);
}

input[aria-invalid="true"] {
    border-color: #b42318;
}

.field-help,
.field-error {
    min-height: 16px;
    font-size: 12px;
}

.field-help {
    color: #768397;
}

.field-error {
    color: #b42318;
}

button {
    height: 52px;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    background-color: var(--brand-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    background-color: var(--brand-primary-dark);
}

button:disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.65;
}

.result {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.result.success {
    color: #08633d;
    background-color: #e8f7ef;
    border: 1px solid #a9dfc0;
}

.result.info {
    color: #075c82;
    background-color: #edf7fc;
    border: 1px solid #b8dce9;
}

.result.error {
    color: #8d2d27;
    background-color: #fff0ee;
    border: 1px solid #f0c0ba;
}

/* Shared transient feedback: never reserves page space or shifts surrounding UI. */
.floating-notification {
    position: fixed !important;
    top: var(--notification-offset, 18px) !important;
    left: 50% !important;
    z-index: 2100 !important;
    display: flex !important;
    width: min(560px, calc(100vw - 32px)) !important;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 !important;
    padding: 12px 12px 12px 16px !important;
    border-radius: 11px !important;
    box-shadow: 0 14px 38px rgba(28, 47, 59, .22);
    transform: translateX(-50%);
    animation: floating-notification-in .22s ease-out both;
}
.floating-notification[hidden] { display: none !important; }
.dashboard-calendar-message.floating-notification {
    color: #8d2d27;
    background: #fff0ee;
    border: 1px solid #f0c0ba;
}
.floating-notification-close {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: currentColor;
    background: transparent;
    font-size: 21px;
    line-height: 1;
    opacity: .72;
}
.floating-notification-close:hover,
.floating-notification-close:focus-visible { color: currentColor; background: rgba(27, 48, 60, .09); opacity: 1; }
@keyframes floating-notification-in {
    from { opacity: 0; transform: translate(-50%, -9px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* Field errors use one anchored overlay, matching native validation without layout shift. */
.field-validation-popover {
    position: fixed;
    z-index: 2200;
    display: flex;
    width: max-content;
    max-width: min(340px, calc(100vw - 20px));
    min-height: 48px;
    align-items: center;
    gap: 10px;
    padding: 9px 12px 9px 9px;
    border: 1px solid #8d969c;
    border-radius: 4px;
    color: #202529;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .28);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
}
.field-validation-popover[hidden] { display: none; }
.field-validation-popover::before,
.field-validation-popover::after {
    content: "";
    position: absolute;
    left: var(--field-arrow-left, 20px);
    width: 0;
    height: 0;
    border-right: 8px solid transparent;
    border-left: 8px solid transparent;
    transform: translateX(-50%);
}
.field-validation-popover::before { top: -9px; border-bottom: 9px solid #8d969c; }
.field-validation-popover::after { top: -7px; border-bottom: 8px solid #fff; }
.field-validation-popover.above::before { top: auto; bottom: -9px; border-top: 9px solid #8d969c; border-bottom: 0; }
.field-validation-popover.above::after { top: auto; bottom: -7px; border-top: 8px solid #fff; border-bottom: 0; }
.field-validation-icon {
    display: grid;
    flex: 0 0 23px;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 2px;
    color: #fff;
    background: #ec650d;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}
.field-validation-invalid { border-color: #dc3545 !important; }
.field-validation-invalid:focus { box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .16) !important; }

/* Native/Bootstrap inline feedback is intentionally replaced by the floating bubble. */
.invalid-feedback,
.invalid-tooltip,
.field-error { display: none !important; min-height: 0 !important; margin: 0 !important; }

@media (max-width: 540px) {
    h1 {
        font-size: 28px;
    }
}
