:root {
    --bg: #f4f7f6;
    --surface: #ffffff;
    --surface-strong: #eaf3f0;
    --text: #14231f;
    --muted: #60726c;
    --border: #dce8e4;
    --accent: #136f63;
    --accent-bright: #16a085;
    --danger: #dd3f4e;
    --warning: #c98719;
    --shadow: 0 24px 70px rgba(19, 63, 56, .12);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 18px clamp(18px, 4vw, 56px);
    background: rgba(244, 247, 246, .86);
    border-bottom: 1px solid rgba(220, 232, 228, .82);
    backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 850;
    letter-spacing: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: inline-block;
    background: conic-gradient(from 210deg, #16a085, #136f63, #0e4f47, #16a085);
    border-radius: 8px;
    box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .48);
}

.brand-text {
    font-size: 21px;
}

.topnav {
    display: flex;
    gap: 20px;
    margin-right: auto;
}

.topnav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 15px;
    font-weight: 650;
}

.topnav a.is-active {
    color: var(--accent);
    font-weight: 850;
}

.auth-actions {
    display: flex;
    gap: 10px;
}

.primary-button,
.ghost-button {
    border: 0;
    border-radius: var(--radius);
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.primary-button {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 24px rgba(19, 111, 99, .2);
}

.ghost-button {
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--border);
}

.primary-button:hover,
.ghost-button:hover {
    transform: translateY(-1px);
}

.large {
    min-height: 52px;
    padding-inline: 22px;
}

.full {
    width: 100%;
}

.user-pill {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    color: var(--muted);
    font-weight: 700;
}

.user-pill button {
    margin-left: 10px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 800;
    cursor: pointer;
}

.hero {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .72fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
    min-height: calc(100vh - 78px);
    padding: 64px 0 42px;
}

.city-label {
    margin: 0 0 18px;
    color: var(--accent);
    font-size: 17px;
    font-weight: 800;
}

.hero h1 {
    margin: 0;
    max-width: 900px;
    font-size: clamp(42px, 6vw, 78px);
    line-height: .98;
    letter-spacing: 0;
}

.hero-lead {
    margin: 24px 0 0;
    max-width: 680px;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 22px);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 34px;
}

.hero-panel {
    position: relative;
    min-height: 460px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(155deg, rgba(255, 255, 255, .98), rgba(234, 243, 240, .92)),
        radial-gradient(circle at 75% 15%, rgba(22, 160, 133, .2), transparent 32%);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.status-orbit {
    position: absolute;
    inset: 46px 36px auto auto;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(19, 111, 99, .18);
    border-radius: 50%;
    animation: floatPulse 6s ease-in-out infinite;
}

.status-orbit::before,
.status-orbit::after {
    content: "";
    position: absolute;
    border-radius: 50%;
}

.status-orbit::before {
    width: 18px;
    height: 18px;
    top: 16px;
    left: 24px;
    background: var(--accent-bright);
}

.status-orbit::after {
    width: 78px;
    height: 78px;
    inset: 35px;
    border: 18px solid rgba(19, 111, 99, .12);
}

.metric-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 160px;
}

.metric-grid article {
    min-height: 120px;
    padding: 18px;
    background: rgba(255, 255, 255, .74);
    border: 1px solid rgba(220, 232, 228, .92);
    border-radius: 8px;
}

.metric-grid span {
    display: block;
    font-size: 38px;
    line-height: 1;
    font-weight: 850;
}

.metric-grid p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.subscription-note {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
}

.workflow-band,
.section-grid,
.issues-section,
.connect-band {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto 28px;
}

.portal-page-head {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
    padding: 58px 0 22px;
}

.portal-page-head p {
    margin: 0 0 10px;
    color: var(--accent);
    font-weight: 850;
}

.portal-page-head h1 {
    margin: 0;
    font-size: clamp(42px, 6vw, 72px);
    line-height: .98;
    letter-spacing: 0;
}

.portal-page-head span {
    display: block;
    max-width: 680px;
    margin-top: 18px;
    color: var(--muted);
    font-size: clamp(18px, 2vw, 22px);
}

.workflow-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.workflow-item {
    padding: 28px;
    background: #fff;
}

.workflow-item span {
    color: var(--accent);
    font-weight: 850;
}

.workflow-item h2 {
    margin: 12px 0 8px;
    font-size: 22px;
}

.workflow-item p,
.section-intro p,
.section-header p,
.connect-band p {
    margin: 0;
    color: var(--muted);
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(260px, .75fr) minmax(340px, 1fr);
    gap: 26px;
    align-items: start;
    padding-top: 54px;
}

.section-intro h2,
.issues-section h2,
.connect-band h2 {
    margin: 0 0 10px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.05;
}

.map-card {
    margin-top: 24px;
    min-height: 280px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    overflow: hidden;
}

.map-placeholder {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    min-height: 280px;
    padding: 24px;
    text-align: center;
    color: var(--muted);
    background:
        linear-gradient(90deg, rgba(19, 111, 99, .08) 1px, transparent 1px),
        linear-gradient(rgba(19, 111, 99, .08) 1px, transparent 1px);
    background-size: 32px 32px;
}

.map-live {
    width: 100%;
    min-height: 360px;
}

.nearby-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.nearby-item {
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 14px;
}

.map-placeholder span {
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--danger);
    box-shadow: 0 18px 32px rgba(221, 63, 78, .24);
}

.map-placeholder strong {
    color: var(--text);
    font-size: 22px;
}

.form-panel {
    display: grid;
    gap: 16px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

label {
    display: grid;
    gap: 7px;
}

label span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfdfc;
    color: var(--text);
    padding: 12px 13px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent-bright);
    box-shadow: 0 0 0 4px rgba(22, 160, 133, .12);
}

.form-message {
    min-height: 22px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

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

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

.issues-section {
    padding-top: 54px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 20px;
}

.search-box {
    width: min(420px, 100%);
}

.issue-list {
    display: grid;
    gap: 12px;
}

.issue-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 190px 150px;
    gap: 18px;
    align-items: start;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.issue-number {
    color: var(--accent);
    font-weight: 850;
}

.issue-row h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.issue-row p {
    margin: 0;
    color: var(--muted);
}

.status-chip {
    justify-self: start;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.connect-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 54px;
    margin-bottom: 60px;
    padding: 34px;
    border-radius: 8px;
    background: #123f38;
    color: #fff;
}

.connect-band p {
    color: #c7ddd8;
    max-width: 720px;
}

.connect-band .ghost-button {
    background: transparent;
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
}

.modal {
    width: min(520px, calc(100% - 28px));
    border: 0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.modal::backdrop {
    background: rgba(9, 22, 19, .44);
    backdrop-filter: blur(8px);
}

.modal-close-form {
    display: flex;
    justify-content: flex-end;
}

.modal-close-form button {
    border: 0;
    background: transparent;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.auth-tabs button {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    min-height: 44px;
    cursor: pointer;
    font-weight: 800;
}

.auth-tabs .is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.auth-form {
    display: grid;
    gap: 14px;
}

.captcha-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 14px;
    align-items: end;
}

.captcha-row img {
    width: 160px;
    height: 60px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.is-hidden {
    display: none !important;
}

@keyframes floatPulse {
    0%, 100% {
        transform: translateY(0) rotate(0);
    }
    50% {
        transform: translateY(10px) rotate(12deg);
    }
}

@media (max-width: 980px) {
    .topnav {
        display: none;
    }

    .hero,
    .section-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 44px;
    }

    .workflow-band {
        grid-template-columns: 1fr;
    }

    .issue-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }

    .auth-actions {
        width: 100%;
    }

    .auth-actions button {
        flex: 1;
    }

    .hero h1 {
        font-size: 42px;
    }

    .hero-panel {
        min-height: 360px;
    }

    .metric-grid {
        margin-top: 110px;
    }

    .section-header,
    .connect-band {
        display: grid;
    }

    .captcha-row {
        grid-template-columns: 1fr;
    }
}
