:root {
    --bg: #f6f8f7;
    --surface: #ffffff;
    --surface-strong: #edf5f2;
    --text: #1d2524;
    --muted: #61706d;
    --border: #d7e0dd;
    --primary: #087f8c;
    --primary-strong: #05616b;
    --accent: #e3a21a;
    --danger: #b42318;
    --success: #157347;
    --shadow: 0 14px 36px rgba(29, 37, 36, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--primary);
    font-weight: 700;
}

button,
input {
    font: inherit;
}

button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

button:disabled {
    cursor: wait;
    opacity: 0.7;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 0.75rem 0.9rem;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.14);
    outline: 0;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: min(100%, 430px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.8rem;
}

.brand-block.compact {
    margin-bottom: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 900;
}

.eyebrow {
    margin: 0 0 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 0;
    font-size: clamp(1.45rem, 2vw, 2rem);
}

h2 {
    margin-bottom: 0;
    font-size: 1.05rem;
}

h3 {
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.stacked-form {
    display: grid;
    gap: 0.65rem;
}

.stacked-form label {
    color: var(--muted);
    font-weight: 700;
}

.primary-button {
    background: var(--primary);
    color: #fff;
    padding: 0 1.05rem;
}

.primary-button:hover {
    background: var(--primary-strong);
}

.secondary-button,
.ghost-button {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    padding: 0 0.95rem;
}

.secondary-button:hover,
.ghost-button:hover {
    border-color: var(--primary);
    color: var(--primary-strong);
}

.message {
    min-height: 1.4rem;
    margin: 0.9rem 0 0;
    color: var(--muted);
    font-weight: 700;
}

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

.message.success {
    color: var(--success);
}

.auth-switch {
    margin: 1.2rem 0 0;
    color: var(--muted);
}

.dashboard-shell {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.2rem 0 2.5rem;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0 1.2rem;
}

.search-band {
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1rem;
    align-items: start;
}

.weather-panel,
.favorites-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.weather-panel {
    min-height: 250px;
}

.favorites-panel {
    grid-row: span 2;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.count-pill {
    min-width: 46px;
    border-radius: 999px;
    background: #fff5dc;
    color: #815700;
    padding: 0.35rem 0.6rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
}

.weather-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.weather-icon {
    width: 72px;
    height: 72px;
    background: #eef9fb;
    border-radius: 8px;
}

.temperature {
    font-size: 2.45rem;
    font-weight: 900;
    line-height: 1;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.meta-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
}

.meta-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.meta-value {
    display: block;
    margin-top: 0.2rem;
    font-weight: 800;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 0.75rem;
    overflow-x: auto;
}

.forecast-card,
.favorite-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    background: #fff;
}

.forecast-card img {
    width: 54px;
    height: 54px;
}

.forecast-temp {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--muted);
    font-weight: 800;
}

.favorites-list {
    display: grid;
    gap: 0.75rem;
}

.favorite-card {
    display: grid;
    gap: 0.55rem;
}

.favorite-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.favorite-weather {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
    font-weight: 700;
}

.favorite-weather img {
    width: 42px;
    height: 42px;
}

.remove-button {
    min-height: 36px;
    border: 1px solid #f2c2bd;
    background: #fff;
    color: var(--danger);
    padding: 0 0.65rem;
}

.empty-state {
    color: var(--muted);
    font-weight: 700;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

    .favorites-panel {
        grid-row: auto;
    }
}

@media (max-width: 560px) {
    .auth-card {
        padding: 1.25rem;
    }

    .dashboard-shell {
        width: min(100% - 1rem, 1180px);
    }

    .topbar,
    .panel-header,
    .favorite-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

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