:root {
    --mdg-primary: #2E7D32;
    --mdg-secondary: #66BB6A;
    --mdg-accent: #A5D6A7;
    --mdg-background: #F8FAF7;
    --mdg-text: #263238;
    --mdg-success: #43A047;
    --mdg-warning: #F9A825;
    --mdg-error: #D32F2F;
    --mdg-info: #0288D1;
    --mdg-card-radius: 12px;
    --mdg-button-radius: 10px;
    --mdg-input-radius: 8px;
    --mdg-space: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background: radial-gradient(circle at top right, rgba(165, 214, 167, 0.25), transparent 35%), var(--mdg-background);
    color: var(--mdg-text);
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: calc(var(--mdg-space) * 3);
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--mdg-space) * 2);
    margin-bottom: calc(var(--mdg-space) * 3);
    padding: calc(var(--mdg-space) * 1.5) calc(var(--mdg-space) * 2);
    background: #ffffff;
    border: 1px solid rgba(102, 187, 106, 0.26);
    border-radius: var(--mdg-card-radius);
    box-shadow: 0 10px 30px rgba(38, 50, 56, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--mdg-space);
    color: var(--mdg-text);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.1px;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(140deg, var(--mdg-primary), var(--mdg-secondary));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--mdg-space) * 1.25);
    align-items: center;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(46, 125, 50, 0.28);
    background: #ffffff;
    color: var(--mdg-primary);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.nav-toggle-bar {
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.nav a {
    color: var(--mdg-primary);
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    padding: 6px 10px;
}

.nav-mobile-only {
    display: none;
}

.nav a:hover,
.nav a:focus-visible {
    background: rgba(46, 125, 50, 0.08);
}

.nav form {
    margin: 0;
}

.card {
    border-radius: var(--mdg-card-radius);
    padding: calc(var(--mdg-space) * 3);
    background: #fff;
    border: 1px solid rgba(102, 187, 106, 0.2);
    box-shadow: 0 12px 32px rgba(38, 50, 56, 0.08);
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
    color: #1f2c32;
    line-height: 1.2;
}

h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); margin-top: calc(var(--mdg-space) * 4); }
h3 { font-size: clamp(1.25rem, 2.3vw, 1.75rem); }
h4 { font-size: clamp(1.125rem, 2vw, 1.375rem); }

p,
li,
label,
input,
button,
select,
textarea,
th,
td {
    font-size: 1rem;
}

small {
    font-size: 0.875rem;
}

em {
    color: #60757f;
}

a {
    color: var(--mdg-primary);
}

a:hover,
a:focus-visible {
    color: #1b5e20;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--mdg-accent);
    color: #1b5e20;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.2px;
}

.btn,
button,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: var(--mdg-button-radius);
    background: var(--mdg-primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    padding: 10px 14px;
    transition: transform 0.1s ease, box-shadow 0.16s ease, background 0.2s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: #246628;
    box-shadow: 0 8px 18px rgba(46, 125, 50, 0.22);
}

.btn:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(2, 136, 209, 0.35);
    outline-offset: 2px;
}

.btn-muted {
    background: #546e7a;
}

.btn-muted:hover {
    background: #455a64;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--mdg-input-radius);
    border: 1px solid #c9d9cd;
    background: #fff;
    color: var(--mdg-text);
}

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    color: #2f3f45;
}

form {
    display: grid;
    gap: calc(var(--mdg-space) * 1.5);
}

.auth-form {
    max-width: 460px;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(280px, 0.95fr);
    gap: calc(var(--mdg-space) * 3);
    align-items: stretch;
}

.login-panel {
    display: grid;
    gap: calc(var(--mdg-space) * 2);
}

.login-panel-primary {
    align-content: start;
}

.login-panel-secondary {
    padding: calc(var(--mdg-space) * 2.5);
    border-radius: 12px;
    background: linear-gradient(165deg, #ffffff 0%, #f2f8f1 100%);
    border: 1px solid rgba(102, 187, 106, 0.22);
}

.login-lead {
    color: #355159;
    max-width: 56ch;
}

.login-cta {
    min-width: 220px;
}

.login-meta {
    margin: 0;
    color: #546b74;
}

.login-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(38, 50, 56, 0.12);
}

.login-support-copy {
    display: grid;
    gap: calc(var(--mdg-space) * 1.5);
}

.login-support-copy h2 {
    margin-top: 0;
    font-size: 1.4rem;
}

.login-benefits {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 8px;
}

.login-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: var(--mdg-space);
    font-weight: 500;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
}

.inline-form {
    display: inline;
}

.link-button {
    display: inline;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--mdg-primary);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.link-button:hover {
    color: #1b5e20;
    box-shadow: none;
    background: transparent;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e4ece7;
    vertical-align: top;
}

thead th {
    font-weight: 700;
    color: #23442a;
    background: #f4f8f3;
}

.table-wrap {
    overflow-x: auto;
}

.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid transparent;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #c6e8cb;
}

.alert-error {
    background: #fdecea;
    color: #b71c1c;
    border-color: #f6c8c4;
}

.home-landing {
    display: grid;
    gap: calc(var(--mdg-space) * 4);
}

.home-hero {
    display: grid;
    gap: calc(var(--mdg-space) * 2);
    padding: calc(var(--mdg-space) * 3);
    border-radius: var(--mdg-card-radius);
    background: linear-gradient(165deg, #ffffff 0%, #f2f8f1 100%);
    border: 1px solid rgba(102, 187, 106, 0.24);
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.hero-content {
    display: grid;
    gap: calc(var(--mdg-space) * 2);
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(38, 50, 56, 0.15);
}

.hero-lead {
    max-width: 70ch;
    color: #304249;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--mdg-space) * 1.25);
}

.marketing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: calc(var(--mdg-space) * 2);
}

.marketing-card {
    padding: calc(var(--mdg-space) * 2);
    border: 1px solid rgba(46, 125, 50, 0.18);
    border-radius: 10px;
    background: #fff;
}

.marketing-card h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.marketing-card p {
    margin-bottom: 0;
    color: #3a4d54;
}

.vision-panel {
    padding: calc(var(--mdg-space) * 2.5);
    border-radius: var(--mdg-card-radius);
    border: 1px solid rgba(2, 136, 209, 0.2);
    background: #f7fbfd;
}

.vision-panel h2 {
    margin-top: 0;
    font-size: 1.4rem;
}

.vision-list {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 6px;
}

.auth-mode-note {
    margin-top: calc(var(--mdg-space) * 2);
    color: #546b74;
}

.dashboard-shell {
    display: grid;
    gap: calc(var(--mdg-space) * 2.5);
}

.dashboard-welcome {
    margin-top: -8px;
    color: #355159;
}

.dashboard-profile {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: calc(var(--mdg-space) * 1.25);
    padding: calc(var(--mdg-space) * 2);
    border-radius: 10px;
    background: #f3f8f2;
    border: 1px solid rgba(102, 187, 106, 0.22);
}

.dashboard-profile p {
    margin: 0;
}

.dashboard-tier-title {
    margin-top: 0;
    margin-bottom: calc(var(--mdg-space) * 1.5);
    font-size: 1.25rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: calc(var(--mdg-space) * 1.5);
}

.dashboard-grid-secondary {
    grid-template-columns: minmax(220px, 380px);
}

.dashboard-link-card {
    display: flex;
    gap: calc(var(--mdg-space) * 1.25);
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    padding: calc(var(--mdg-space) * 1.75);
    border-radius: 12px;
    border: 1px solid rgba(46, 125, 50, 0.16);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(38, 50, 56, 0.06);
    transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-link-card:hover,
.dashboard-link-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(38, 50, 56, 0.1);
    border-color: rgba(46, 125, 50, 0.35);
    color: inherit;
}

.dashboard-link-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: #e6f3e5;
}

.dashboard-link-content {
    display: grid;
    gap: 2px;
}

.dashboard-link-title {
    font-weight: 700;
    color: #23412a;
}

.dashboard-link-text {
    color: #4a6169;
    font-size: 0.94rem;
}

.dashboard-map-tile-link {
    display: block;
    width: 50%;
    min-width: 280px;
    border-radius: 12px;
    border: 1px solid rgba(46, 125, 50, 0.2);
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(38, 50, 56, 0.08);
}

.dashboard-map-tile-link:hover,
.dashboard-map-tile-link:focus-visible {
    border-color: rgba(46, 125, 50, 0.38);
    box-shadow: 0 12px 24px rgba(38, 50, 56, 0.14);
}

.dashboard-map-static-frame {
    display: block;
    width: 100%;
    height: 200px;
    border: 0;
    pointer-events: none;
}

.dashboard-map-caption {
    margin-top: 10px;
    color: #4a6169;
    font-size: 0.9rem;
}

.feature-with-image {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--mdg-space) * 2.5);
    align-items: center;
    padding: calc(var(--mdg-space) * 2.5);
    border-radius: var(--mdg-card-radius);
    background: #fafbfa;
    border: 1px solid rgba(102, 187, 106, 0.18);
}

.feature-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(38, 50, 56, 0.12);
}

.feature-text h2 {
    margin-top: 0;
    font-size: 1.35rem;
}

.feature-text p {
    color: #3a525b;
}

@media (max-width: 720px) {
    .container {
        padding: calc(var(--mdg-space) * 2);
    }

    .topbar {
        align-items: flex-start;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: calc(var(--mdg-space) * 0.75);
        padding-top: calc(var(--mdg-space) * 1);
        border-top: 1px solid rgba(102, 187, 106, 0.24);
    }

    .nav[data-open="true"] {
        display: flex;
    }

    .nav a {
        display: block;
        width: 100%;
        padding: 10px 12px;
    }

    .nav-mobile-only {
        display: block;
    }

    .nav form {
        width: 100%;
    }

    .nav form .btn {
        width: 100%;
    }

    .card {
        padding: calc(var(--mdg-space) * 2);
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-panel-secondary {
        padding: calc(var(--mdg-space) * 2);
    }

    .home-hero {
        padding: calc(var(--mdg-space) * 2);
        grid-template-columns: 1fr;
    }

    .dashboard-profile {
        grid-template-columns: 1fr;
    }

    .dashboard-grid-secondary {
        grid-template-columns: 1fr;
    }

    .dashboard-map-tile-link {
        width: 100%;
        min-width: 0;
    }

    .feature-with-image {
        grid-template-columns: 1fr;
        gap: calc(var(--mdg-space) * 2);
        padding: calc(var(--mdg-space) * 2);
    }
}
