:root {
    --primary: #1769e0;
    --primary-dark: #0f51b5;
    --ink: #172033;
    --muted: #687386;
    --line: #dfe5ee;
    --soft: #f4f7fb;
    --white: #ffffff;
    --success: #18864b;
    --danger: #c43c3c;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

/* ==========================================
   GENERAL RESET
========================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--white);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

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

.container {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
}

.narrow {
    width: min(780px, calc(100% - 32px));
}

.auth-narrow {
    width: min(580px, calc(100% - 32px));
}

/* ==========================================
   HEADER
========================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
}

.nav {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ==========================================
   KINDFIND LOGO
========================================== */

.brand-logo-link {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    overflow: visible;
}

.site-logo {
    position: static !important;
    display: block;
    width: 320px !important;
    max-width: 320px !important;
    height: auto !important;
    max-height: 68px;
    object-fit: contain;
    transform: none !important;
}

.brand-logo-link:hover .site-logo {
    transform: none !important;
}

.logo-crop {
    display: none !important;
}

/* ==========================================
   NAVIGATION
========================================== */

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    white-space: nowrap;
}

.desktop-nav > a:not(.button) {
    color: var(--ink);
    font-weight: 600;
    transition: color 0.2s ease;
}

.desktop-nav > a:not(.button):hover {
    color: var(--primary);
}

/* ==========================================
   BUTTONS
========================================== */

.button {
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 20px;
    border-radius: 13px;
    background: var(--primary);
    color: white;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(31, 111, 235, 0.16);
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(31, 111, 235, 0.22);
}

.button.secondary {
    background: white;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: none;
}

.button.secondary:hover {
    background: var(--soft);
}

.button.small {
    min-height: 42px;
    padding: 9px 16px;
}

.button.full {
    width: 100%;
}

/* ==========================================
   HERO
========================================== */

.hero {
    padding: 88px 0;
    background:
        radial-gradient(
            circle at top right,
            #e4ecff,
            transparent 36%
        ),
        linear-gradient(
            180deg,
            #fbfdff,
            #f1f6ff
        );
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
}

.hero h1 {
    margin: 14px 0 22px;
    font-size: clamp(2.8rem, 7vw, 5.7rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero p {
    max-width: 660px;
    font-size: 1.13rem;
    color: var(--muted);
}

.eyebrow {
    color: var(--primary);
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.76rem;
}

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

.hero-card,
.form-card,
.detail-card,
.search-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 26px;
    box-shadow: 0 18px 60px rgba(31, 47, 76, 0.09);
}

.hero-card form {
    display: grid;
    gap: 12px;
}

.hero-icon {
    font-size: 2.2rem;
}

/* ==========================================
   FORM FIELDS
========================================== */

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: white;
    color: var(--ink);
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
}

textarea {
    resize: vertical;
}

/* ==========================================
   STATISTICS
========================================== */

.stats-section {
    margin-top: -24px;
    position: relative;
    z-index: 2;
}

.stats-grid,
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.stats-grid > div,
.dashboard-cards > div {
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 14px 40px rgba(31, 47, 76, 0.08);
}

.stats-grid strong,
.dashboard-cards strong {
    display: block;
    font-size: 2rem;
}

.stats-grid span,
.dashboard-cards span {
    color: var(--muted);
}

/* ==========================================
   SECTIONS
========================================== */

.section {
    padding: 70px 0;
}

.section.soft {
    background: var(--soft);
}

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

.section-heading h2,
.page-heading h1,
.dashboard-header h1 {
    margin: 5px 0 0;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.03em;
}

.page-heading {
    margin-bottom: 28px;
}

.page-heading p,
.dashboard-header p {
    color: var(--muted);
}

/* ==========================================
   ITEM CARDS
========================================== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.item-card {
    overflow: hidden;
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(31, 47, 76, 0.12);
}

.item-image {
    height: 220px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    background: #eef2f7;
    font-size: 3rem;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.lost {
    background: #fff0df;
    color: #9b4f00;
}

.badge.found {
    background: #e4f8ec;
    color: #116438;
}

.item-content {
    padding: 18px;
}

.item-content h3 {
    margin: 4px 0 8px;
}

.item-content p,
.item-content small {
    color: var(--muted);
    margin: 0;
}

.category {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
}

/* ==========================================
   PROCESS STEPS
========================================== */

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.steps > div {
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
}

.steps strong {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: white;
}

.steps h3 {
    margin-bottom: 4px;
}

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

/* ==========================================
   FORM LAYOUT
========================================== */

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 22px;
}

.form-grid label {
    font-weight: 700;
}

.form-grid small {
    display: block;
    color: var(--muted);
    font-weight: 400;
    margin-top: 5px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

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

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.checkbox-row input {
    width: auto;
    margin-top: 6px;
}

/* ==========================================
   LOST / FOUND TYPE SWITCH
========================================== */

.type-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.type-switch input {
    display: none;
}

.type-switch span {
    display: block;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    font-weight: 800;
    cursor: pointer;
}

.type-switch input:checked + span {
    border-color: var(--primary);
    background: #edf4ff;
    color: var(--primary);
}

/* ==========================================
   ALERTS
========================================== */

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-weight: 700;
}

.alert.error {
    background: #fff0f0;
    color: var(--danger);
    border: 1px solid #ffd0d0;
}

.alert.success {
    background: #eaf8f0;
    color: var(--success);
    border: 1px solid #c3ead3;
}

.auth-link {
    text-align: center;
    color: var(--muted);
}

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

/* ==========================================
   SEARCH
========================================== */

.search-panel {
    display: grid;
    grid-template-columns: 1.8fr repeat(4, 1fr) auto;
    gap: 10px;
    margin-bottom: 24px;
}

.result-count {
    margin-bottom: 20px;
    color: var(--muted);
    font-weight: 700;
}

.empty-state {
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 22px;
    padding: 52px 24px;
    background: #fbfcfe;
}

/* ==========================================
   ITEM DETAILS
========================================== */

.detail-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 34px;
    align-items: start;
}

.gallery {
    display: grid;
    gap: 14px;
}

.gallery img,
.gallery-placeholder {
    width: 100%;
    min-height: 360px;
    object-fit: cover;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--soft);
}

.gallery-placeholder {
    display: grid;
    place-items: center;
    font-size: 5rem;
}

.detail-card {
    position: sticky;
    top: 110px;
}

.detail-card h1 {
    font-size: 2.3rem;
    line-height: 1.1;
    margin: 8px 0 14px;
}

.detail-badges {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.detail-badges .badge {
    position: static;
}

.status-badge {
    padding: 6px 11px;
    background: var(--soft);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.location,
.date,
.description {
    color: var(--muted);
}

.reward-box,
.safe-note,
.contact-box {
    margin: 18px 0;
    border-radius: 14px;
    padding: 14px 16px;
    background: #fff8df;
    border: 1px solid #f4df9c;
}

.safe-note {
    background: #edf4ff;
    border-color: #c7dcff;
}

.contact-box {
    background: var(--soft);
    border-color: var(--line);
}

/* ==========================================
   FOOTER
========================================== */

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 30px;
}

.footer-grid div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 32px 0;
    color: var(--muted);
}

/* ==========================================
   TABLET
========================================== */

@media (max-width: 980px) {

    .site-logo {
        width: 250px !important;
        max-width: 250px !important;
    }

    .desktop-nav {
        gap: 13px;
    }

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

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .detail-card {
        position: static;
    }
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 680px) {

    .container {
        width: min(100% - 24px, 1160px);
    }

    .nav {
        min-height: 68px;
        gap: 10px;
    }

    .brand-logo-link {
        min-width: 0;
        flex: 1 1 auto;
    }

    .site-logo {
        width: 185px !important;
        max-width: 185px !important;
        max-height: 52px;
    }

    .desktop-nav {
        flex: 0 0 auto;
        gap: 6px;
    }

    .desktop-nav a:not(.button) {
        display: none;
    }

    .desktop-nav .button.small {
        padding: 8px 10px;
        min-height: 38px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .hero {
        padding: 54px 0;
    }

    .hero h1 {
        font-size: clamp(2.4rem, 13vw, 4rem);
    }

    .card-grid,
    .steps,
    .form-grid,
    .type-switch,
    .search-panel,
    .stats-grid,
    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .form-grid .full {
        grid-column: auto;
    }

    .section {
        padding: 48px 0;
    }

    .section-heading,
    .dashboard-header,
    .footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================
   SMALL MOBILE
========================================== */

@media (max-width: 420px) {

    .site-logo {
        width: 150px !important;
        max-width: 150px !important;
    }

    .desktop-nav .button.small {
        padding: 8px 9px;
        font-size: 0.74rem;
    }
}
