:root {
    --primary: #386df5;
    --primary-dark: #2d5ddd;
    --text: #18213a;
    --muted: #6f7890;
    --border: #e1e6ef;
    --surface: #fff;
}

html,
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: #f5f7fb;
}

* {
    box-sizing: border-box;
}

a {
    color: var(--primary);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: .5rem;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    letter-spacing: -.035em;
}

h2 {
    font-size: 1.2rem;
}

h1:focus {
    outline: none;
}

.btn {
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border-radius: 8px;
    padding: .62rem 1.05rem;
    font-weight: 650;
}

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

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

.btn:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 .2rem rgba(56, 109, 245, .18);
}

.form-control {
    min-height: 46px;
    border-color: #d7ddea;
    border-radius: 8px;
    padding: .7rem .85rem;
}

.form-control:focus {
    border-color: #7899f8;
}

.form-label {
    margin-bottom: .45rem;
    font-size: .86rem;
    font-weight: 650;
}

.validation-message,
.text-danger {
    color: #c83d4d !important;
    font-size: .82rem;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.page-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.eyebrow {
    display: block;
    margin-bottom: .45rem;
    color: var(--primary);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    white-space: nowrap;
    border-radius: 999px;
    padding: .48rem .75rem;
    font-size: .75rem;
    font-weight: 700;
}

.status-success {
    color: #187449;
    background: #e8f8f0;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

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

.status-card,
.panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 4px 20px rgba(24, 33, 58, .035);
}

.status-card {
    display: flex;
    align-items: center;
    gap: .95rem;
    min-height: 118px;
    padding: 1.2rem;
}

.status-card > div:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.status-icon {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--primary);
    background: #edf2ff;
    font-size: .72rem;
    font-weight: 800;
}

.status-label,
.status-card small {
    color: var(--muted);
    font-size: .75rem;
}

.status-card strong {
    margin: .18rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .94rem;
}

.dashboard-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 1.5rem;
}

.dashboard-panel h2,
.dashboard-panel p {
    margin-bottom: .35rem;
}

.dashboard-panel p,
.timestamp {
    color: var(--muted);
}

.timestamp {
    margin-top: 1rem;
    font-size: .75rem;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: 1rem;
    border: 1px solid #cfddff;
    border-radius: 10px;
    padding: 1rem;
    color: #35538e;
    background: #f0f5ff;
}

.notice p {
    margin: 0;
    font-size: .86rem;
    line-height: 1.55;
}

.notice-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--primary);
    font-size: .72rem;
    font-weight: 800;
}

.ai-panel {
    padding: 1.5rem;
}

.prompt-input {
    min-height: 145px;
    resize: vertical;
}

.field-footer {
    min-height: 28px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .3rem;
}

.field-footer > span:last-child {
    margin-left: auto;
    color: #9199aa;
    font-size: .72rem;
}

.send-button {
    margin-top: .65rem;
}

.result-alert {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    margin-top: 1rem;
    border-radius: 10px;
}

.response-panel {
    margin-top: 1rem;
    padding: 1.5rem;
}

.response-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.response-heading h2 {
    margin-bottom: 0;
}

.response-content {
    padding-top: 1.2rem;
    white-space: pre-wrap;
    line-height: 1.7;
}

.login-card {
    width: min(100%, 440px);
    position: relative;
    z-index: 1;
    border: 1px solid #e2e6ef;
    border-radius: 16px;
    padding: 2.2rem;
    background: white;
    box-shadow: 0 22px 65px rgba(24, 33, 58, .1);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 2.25rem;
}

.login-brand .brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: white;
    background: linear-gradient(135deg, #5d8aff, #6b5ce7);
    font-weight: 800;
}

.login-brand > span:last-child {
    display: flex;
    flex-direction: column;
}

.login-brand small {
    color: var(--muted);
    font-size: .69rem;
}

.login-heading {
    margin-bottom: 1.5rem;
}

.login-heading h1 {
    font-size: 1.85rem;
}

.login-heading p,
.login-help {
    color: var(--muted);
}

.remember-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .2rem 0 1.2rem;
    color: #525d75;
    font-size: .84rem;
}

.login-button {
    min-height: 47px;
}

.login-help {
    margin: 1.3rem 0 0;
    border-top: 1px solid var(--border);
    padding-top: 1.1rem;
    text-align: center;
    font-size: .75rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26a269;
}

.invalid {
    outline: 1px solid #c83d4d;
}

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: #a92e3d;
}

@media (max-width: 900px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .page-heading,
    .dashboard-panel,
    .response-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading .status-pill,
    .response-heading .status-pill {
        align-self: flex-start;
    }

    .dashboard-panel .btn {
        width: 100%;
    }

    .login-card {
        padding: 1.5rem;
    }
}
