/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
    /* Brand */
    --brand: rgb(255, 123, 75);
    --brand-strong: rgb(255, 92, 33);
    --tint-page: rgba(255, 170, 139, 0.377);
    --tint-footer: rgba(255, 123, 75);

    /* Login card aliases (kept so existing markup/JS still resolves them) */
    --primary-color: var(--brand-strong);
    --gray-border: #d9d9d9;
    --gray: #727586;
    --dark: #262626;

    /* Neutrals */
    --white: #fff;
    --text-strong: #222;
    --text-muted: #777;
    --surface-alt: #f4f4f4;
    --surface-alt-hover: #ececec;
    --line: #ddd;
    --line-strong: #333;

    /* Glass nav */
    --nav-bg: rgba(255, 255, 255, 0.15);
    --nav-bg-hover: rgba(255, 255, 255, 0.25);
    --nav-border: rgba(255, 255, 255, 0.3);
    --nav-border-hover: rgba(255, 255, 255, 0.5);
    --nav-ring: rgba(255, 255, 255, 0.25);

    /* Accents */
    --focus-ring: rgba(255, 69, 0, 0.12);
    --btn-glow: rgba(255, 69, 0, 0.25);
    --overlay: rgba(38, 38, 38, 0.7);

    /* Status — the only hue outside the brand, reserved for state that must
       not be mistaken for a brand accent (connected / paid). */
    --ok: #2e9e5b;
    --ok-text: #1f7a45;
    --ok-soft: rgba(46, 158, 91, 0.12);
    --ok-ring: rgba(46, 158, 91, 0.18);

    /* Shape */
    --radius-sm: 8px;
    --radius-md: 8px;
    --radius-lg: 18px;

    /* Motion */
    --speed: 0.2s;
    --ease: ease;
}

/* ==========================================================================
   Base
   ========================================================================== */

body {
  /* Step 1: Ensure the body spans at least the full viewport height */
  min-height: 100vh; 
  min-height: 100dvh; /* dvh handles dynamic mobile toolbars perfectly */

      margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: var(--tint-page);
  
  /* Step 2: Use flexbox layout stacked vertically */
  display: flex;
  flex-direction: column;
  
  /* Step 3: Clear default browser margins */
  margin: 0;
}

/* Visually hidden, still read by screen readers. */
.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;
}

/* ==========================================================================
   Header
   ========================================================================== */

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--brand);
    border-bottom: 1px solid var(--brand-strong);
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.main-header nav {
    display: flex;
    align-items: center;
    gap: 1rem; /* spacing between button and dropdown */
}

.nav-item {
    font: inherit;
    color: var(--white);
    background-color: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    text-decoration: none;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition:
        background-color var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease);
}

.nav-item:hover {
    background-color: var(--nav-bg-hover);
    border-color: var(--nav-border-hover);
}

.nav-item:focus-visible {
    outline: none;
    border-color: var(--nav-border-hover);
    box-shadow: 0 0 0 3px var(--nav-ring);
}

/* Language dropdown -------------------------------------------------------- */

select.nav-item {
    min-width: 140px;
    padding-right: 2.5rem; /* room for the chevron */

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* custom chevron, drawn in white to match the nav text */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 0.85rem;
}

/* The popup list. Honoured by Chrome/Edge and Firefox on Windows and Linux;
   Safari and Firefox on macOS draw the system popup regardless. */
select.nav-item option {
    background-color: var(--brand);
    color: var(--white);
}

select.nav-item option:checked {
    background-color: var(--brand-strong);
}

/* ==========================================================================
   Page
   ========================================================================== */

section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 1.25rem;
}

/* ==========================================================================
   Login card
   ========================================================================== */

#login-form {
    width: 100%;
    max-width: 28rem;

    padding: 2.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.04);

    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header-form {
    text-align: center;
    margin-bottom: 1rem;
}

.header-form .title {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.4rem;
}

.header-form .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Inputs ------------------------------------------------------------------- */

#login-form input,
.modal-card input {
    font: inherit;
    padding: 0.9rem 1rem;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-md);
    outline: none;
    transition:
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease);
}

#login-form input:focus,
.modal-card input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--focus-ring);
}

/* Buttons ------------------------------------------------------------------ */

#login-form button,
.modal-card button {
    font: inherit;
    font-weight: 600;
    padding: 0.9rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition:
        background-color var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease),
        transform var(--speed) var(--ease);
}

#login-form button[type="submit"],
.modal-card button[type="submit"] {
    background: var(--primary-color);
    color: var(--white);
}

#login-form button[type="submit"]:hover,
.modal-card button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--btn-glow);
}

#signup-btn {
    background: var(--surface-alt);
    color: var(--dark);
    border: 1px solid var(--line);
}

#signup-btn:hover {
    background: var(--surface-alt-hover);
}

/* reCAPTCHA ---------------------------------------------------------------- */

/* Google's checkbox is a fixed 304x78px iframe. Reserve its height so the
   button doesn't jump down when it loads, and centre it in the card. */
#login-form .captcha {
    display: flex;
    justify-content: center;
    min-height: 78px;
}

/* Below ~400px the card is narrower than the widget, so shrink it to fit. */
@media (max-width: 400px) {
    #login-form .g-recaptcha {
        transform: scale(0.77);
        transform-origin: center top;
    }
}

/* Divider ------------------------------------------------------------------ */

.division-or {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.division-or span {
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
}

.h-line {
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ==========================================================================
   Blocking modal (first-login email capture)
   ========================================================================== */

body.modal-locked {
    overflow: hidden;
}

/* .main-header isn't positioned, so it can't beat the overlay's z-index on its
   own — without this the Log out button sits underneath the overlay and stops
   being clickable, trapping anyone who lands here by mistake. */
body.modal-locked .main-header {
    position: relative;
    z-index: 1001;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    overflow-y: auto;

    /* Top padding clears the header, which floats above the overlay. */
    padding: 7rem 1.5rem 2rem;

    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-card {
    /* margin: auto rather than align-items: center — a card taller than the
       viewport would otherwise have its top edge clipped and unscrollable. */
    margin: auto;

    width: 100%;
    max-width: 28rem;
    padding: 2.5rem;

    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.18),
        0 2px 10px rgba(0, 0, 0, 0.08);

    animation: modal-in var(--speed) var(--ease);
}

.modal-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-note {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray);
}

@keyframes modal-in {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: translateY(0);   opacity: 1; }
}

/* ==========================================================================
   Dashboard shell
   ========================================================================== */

.app-shell {
    flex: 1;              /* body is a column flex container, so this fills it */
    display: flex;
    align-items: stretch; /* lets the orange panel run the full height */
    min-width: 0;
}

/* Side panel --------------------------------------------------------------- */

.side-panel {
    flex: 0 0 15rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.5rem 1.25rem;

    background: var(--brand);
    border-right: 1px solid var(--brand-strong);
}

.panel-logo {
    padding: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--white);
    text-decoration: none;
}

.panel-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.panel-item {
    font: inherit;
    font-weight: 600;
    color: var(--white);
    text-decoration: none;

    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);

    transition:
        background-color var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        color var(--speed) var(--ease);
}

.panel-item:hover {
    background-color: var(--nav-bg-hover);
    border-color: var(--nav-border);
}

.panel-item:focus-visible {
    outline: none;
    border-color: var(--nav-border-hover);
    box-shadow: 0 0 0 3px var(--nav-ring);
}

/* The one loud move in the layout: the current tab inverts to a solid white
   pill, so your place in the nav is readable at a glance. */
.panel-item.is-active,
.panel-item.is-active:hover {
    background-color: var(--white);
    border-color: var(--white);
    color: var(--brand-strong);
}

.panel-foot {
    margin-top: auto;      /* pins language + log out to the bottom */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.panel-foot form {
    margin: 0;
}

.panel-foot .nav-item,
.panel-foot select.nav-item {
    width: 100%;
    min-width: 0;
    text-align: left;
}

/* Main column -------------------------------------------------------------- */

.app-main {
    flex: 1;
    min-width: 0;          /* stops wide tables from squeezing the panel */
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 2rem 2.5rem 3rem;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.topbar-title h1 {
    margin: 0;
    font-size: 1.9rem;
    color: var(--text-strong);
}

.topbar-title p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.account-chip {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: right;

    padding: 0.9rem 1.15rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chip-greeting {
    font-weight: 600;
    color: var(--text-strong);
}

.chip-account {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--brand-strong);
}

.chip-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Cards -------------------------------------------------------------------- */

.card {
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.06),
        0 2px 10px rgba(0, 0, 0, 0.03);
}

.card h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-strong);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.card-text {
    margin: 0 0 1.25rem;
    color: var(--text-muted);
    max-width: 60ch;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1.25rem;
}

/* Connection status -------------------------------------------------------- */

.status-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.status-body {
    flex: 1;
    min-width: 12rem;
}

.status-body p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

/* Stats -------------------------------------------------------------------- */

.stat-label {
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-value {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-strong);
}

.stat-note {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--gray);
}

/* Tables ------------------------------------------------------------------- */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 0 0.75rem 0.65rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.data-table td {
    padding: 0.85rem 0.75rem;
    border-top: 1px solid var(--line);
    color: var(--text-strong);
}

.data-table .row-action {
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-ok {
    background: var(--ok-soft);
    color: var(--ok-text);
}

.badge-idle {
    background: var(--surface-alt);
    color: var(--gray);
}

/* Detail rows -------------------------------------------------------------- */

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--line);
}

.detail-row:first-of-type {
    border-top: none;
    padding-top: 0;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    font-weight: 600;
    color: var(--text-strong);
    text-align: right;
}

/* Buttons ------------------------------------------------------------------ */

.btn {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 0.7rem 1.15rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    transition:
        background-color var(--speed) var(--ease),
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease),
        transform var(--speed) var(--ease);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--btn-glow);
}

.btn-quiet {
    background: var(--surface-alt);
    color: var(--dark);
    border-color: var(--line);
}

.btn-quiet:hover {
    background: var(--surface-alt-hover);
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    background-color: var(--tint-footer);
    color: #000;
    margin-top: auto; 
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem;

    display: flex;
    justify-content: space-between;
    gap: 3rem;
}

.footer-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.footer-section p {
    margin: 0;
    color: #000;
}

.footer-section a {
    color: #000;
    text-decoration: none;
    transition: color var(--speed) var(--ease);
}

.footer-section a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid var(--line-strong);
    text-align: center;
    padding: 1rem;
}

.footer-bottom p {
    margin: 0;
    color: #000;
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* The side panel turns into a horizontal strip before the tabs get too
   cramped to hit, which happens above the 768px header breakpoint. */
@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }

    .side-panel {
        flex: none;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.75rem;
        border-right: none;
        border-bottom: 1px solid var(--brand-strong);
    }

    .panel-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .panel-foot {
        margin-top: 0;
        margin-left: auto;
        flex-direction: row;
        align-items: center;
    }

    .panel-foot .nav-item,
    .panel-foot select.nav-item {
        width: auto;
    }

    .app-main {
        padding: 1.5rem 1.5rem 2.5rem;
    }

    .app-topbar {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .account-chip {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .main-header nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .logo {
        font-size: 1.2rem;
    }

    /* The header stacks vertically here, so it needs more clearance. */
    .modal-overlay {
        padding-top: 11rem;
    }
}

@media (max-width: 700px) {
    .footer-container {
        flex-direction: column;
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    section {
        padding: 2rem 1rem;
    }

    #login-form {
        padding: 2rem 1.5rem;
    }

    .header-form .title {
        font-size: 1.7rem;
    }

    .modal-overlay {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .modal-card {
        padding: 2rem 1.5rem;
    }

    .app-main {
        padding: 1.25rem 1rem 2rem;
    }

    .card {
        padding: 1.25rem;
    }

    .card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-title h1 {
        font-size: 1.5rem;
    }

    /* Five columns won't fit; scroll the table rather than squashing the date
       column onto three lines. */
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
:root {
    --err: #b3261e;
    --err-text: #8c1d18;
    --err-soft: rgba(179, 38, 30, 0.1);
}
 
/* ==========================================================================
   Flash messages
   ========================================================================== */
 
/* Your templates have been emitting .flash since the login page was written,
   but the class was never styled — these have been rendering as bare text. */
.flash {
    margin: 0;
    padding: 0.85rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
}
 
.flash-error {
    background: var(--err-soft);
    border-color: rgba(179, 38, 30, 0.25);
    color: var(--err-text);
}
 
.flash-info {
    background: var(--ok-soft);
    border-color: var(--ok-ring);
    color: var(--ok-text);
}
 
/* ==========================================================================
   Devices
   ========================================================================== */
 
.allowance {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
 
.meter {
    height: 0.5rem;
    margin-bottom: 1.25rem;
    border-radius: 999px;
    background: var(--surface-alt);
    overflow: hidden;
}
 
.meter-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand-strong);
    transition: width var(--speed) var(--ease);
}
 
.card-note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--err-text);
}
 
/* Inline form row (device name + submit) ----------------------------------- */
 
.form-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: stretch;
}
 
.form-row input[type="text"] {
    flex: 1;
    min-width: 12rem;
    font: inherit;
    padding: 0.7rem 1rem;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius-md);
    outline: none;
    transition:
        border-color var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease);
}
 
.form-row input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--focus-ring);
}
 
/* Disabled controls must look unavailable, not just refuse to respond. */
.form-row input[type="text"]:disabled {
    background: var(--surface-alt);
    color: var(--gray);
    cursor: not-allowed;
}
 
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
 
.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}
 
/* Device rows -------------------------------------------------------------- */
 
.device-name {
    display: block;
    font-weight: 600;
}
 
.device-sub {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
 
.mono {
    font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}
 
/* Each revoke button sits in its own form; without this the form's block
   display pushes the button onto a line of its own. */
.row-action form {
    display: inline;
    margin: 0;
}
 
.empty-state {
    margin: 0;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}
 
@media (max-width: 480px) {
    .form-row input[type="text"],
    .form-row .btn {
        width: 100%;
        flex: none;
    }
}
 
/* ==========================================================================
   Landing Page
   ========================================================================== */

.hero {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 1rem;
}

.hero h1 {
    margin: 0 0 1rem;
    font-size: 3rem;
    color: var(--text-strong);
}

.hero p {
    max-width: 700px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-secondary {
    display: inline-block;
    padding: 0.7rem 1.15rem;
    background: var(--surface-alt);
    color: var(--dark);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--speed) var(--ease);
}

.btn-secondary:hover {
    background: var(--surface-alt-hover);
    transform: translateY(-2px);
}

/* Features */

.features {
    width: 100%;
    max-width: 1100px;
    margin: 4rem auto;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-strong);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--white);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.06),
        0 2px 10px rgba(0,0,0,0.03);
    transition: transform var(--speed) var(--ease);
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-card h3 {
    margin-top: 0;
    color: var(--brand-strong);
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Stats */

.stats {
    width: 100%;
    max-width: 1000px;
    margin: 4rem auto;
    text-align: center;
}

.stats h2 {
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.stat {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.06),
        0 2px 10px rgba(0,0,0,0.03);
}

.stat h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--brand-strong);
}

.stat p {
    margin-top: 0.5rem;
    color: var(--text-muted);
}

/* CTA */

.cta {
    width: 100%;
    max-width: 900px;
    margin: 4rem auto;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow:
        0 10px 30px rgba(0,0,0,0.06),
        0 2px 10px rgba(0,0,0,0.03);
}

.cta h2 {
    margin-top: 0;
    color: var(--text-strong);
}

.cta p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Mobile */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
}

.social-links {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;   /* comfortable touch target */
    min-height: 44px;
    border-radius: 8px;
    transition: opacity 0.2s ease;
}

.social-links a:hover {
    opacity: 0.75;
}

.social-links a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.social-links img {
    display: block;
    width: 24px;
    height: 24px;
}
