/* Paleta cívica editorial do "De Olho em Iguape" */
:root {
    --brand-primary: #14837B;
    --brand-secondary: #F2A900;
    --brand-alert: #C94A1F;
    --brand-ink: #1B2A3E;
    --brand-muted: #5B6B7F;
    --brand-border: #DDE3EA;
    --brand-paper: #FDFDFD;
    --brand-surface: #F1F4F8;
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: var(--brand-paper);
    color: var(--brand-ink);
}

/* KPI cards clicáveis na home */
.kpi-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.kpi-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent;
}
.kpi-link:hover .kpi-card {
    box-shadow: 0 6px 20px rgba(20, 40, 70, 0.10);
    transform: translateY(-2px);
    border-color: var(--brand-primary);
}
.kpi-link:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 4px;
    border-radius: 8px;
}

h1, h2, h3, h4, h5, h6,
.mud-typography-h1, .mud-typography-h2, .mud-typography-h3,
.mud-typography-h4, .mud-typography-h5, .mud-typography-h6 {
    font-family: 'Fraunces', Georgia, serif !important;
    letter-spacing: -0.01em;
    font-weight: 700;
}

h1:focus { outline: none; }

/* Validação */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}
.invalid {
    outline: 1px solid var(--brand-alert);
}
.validation-message {
    color: var(--brand-alert);
}

/* Blazor Server error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: #FFFBEB;
    border-top: 3px solid var(--brand-alert);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    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: var(--brand-alert);
    padding: 1rem;
    color: white;
    border-radius: 6px;
}
.blazor-error-boundary::after {
    content: "Ocorreu um erro inesperado.";
}

/* Leaflet popup — combinar com paleta */
.leaflet-container {
    background: #EAF0F5;
    font-family: 'Inter', system-ui, sans-serif;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #ffffff;
    color: var(--brand-ink);
    box-shadow: 0 6px 20px rgba(20, 40, 70, 0.15);
}
.leaflet-popup-content {
    margin: 12px 14px;
    font-size: 13px;
    line-height: 1.4;
}

/* ============================================================
   Auth (Login, ForgotPassword etc.) — visual coerente com marca
   ============================================================ */
.auth-wrapper {
    min-height: calc(100vh - 128px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    background: linear-gradient(180deg, rgba(242,169,0,0.06), transparent 40%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    border-radius: 12px !important;
    background: #FFFFFF;
    border: 1px solid var(--brand-border);
}

.auth-logo {
    display: flex;
    justify-content: center;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-muted);
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'Inter', system-ui, sans-serif;
    background: #FFFFFF;
    color: var(--brand-ink);
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.auth-input::placeholder { color: #94A3B8; }
.auth-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(20, 131, 123, 0.15);
}
.auth-input.modified.invalid {
    border-color: var(--brand-alert);
    box-shadow: 0 0 0 3px rgba(201, 74, 31, 0.15);
}

.auth-error {
    color: var(--brand-alert);
    font-size: 12px;
    margin-top: 2px;
    min-height: 16px;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--brand-ink);
}
.auth-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-primary);
    cursor: pointer;
}
.auth-check label { cursor: pointer; }

.auth-submit {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', system-ui, sans-serif;
    color: #FFFFFF;
    background: var(--brand-primary);
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.auth-submit:hover {
    background: #106e68;
    box-shadow: 0 4px 12px rgba(20, 131, 123, 0.25);
}
.auth-submit:active { transform: translateY(1px); }
.auth-submit:focus-visible {
    outline: 3px solid rgba(20, 131, 123, 0.4);
    outline-offset: 2px;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--brand-muted);
    flex-wrap: wrap;
}
.auth-links a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
}
.auth-links a:hover { text-decoration: underline; }
.auth-links-sep { color: var(--brand-border); }
