@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --brand: #f4be4c;
    --brand-deep: #e7a42f;
    --brand-soft: #fff1cf;
    --footer-bg: #f3f3f3;
    --ink: #212529;
    --muted: #69707a;
    --body-copy: #5e6670;
    --header-title: #ffffff;
    --nav-active: #212529;
    --nav-inactive: #7d7d7d;
    --surface: #ffffff;
    --surface-alt: #fff8e8;
    --divider: rgba(33, 37, 41, 0.12);
    --shadow-soft: 0 14px 32px rgba(33, 37, 41, 0.12);
    --shadow-strong: 0 30px 70px rgba(33, 37, 41, 0.16);
    --lost: #ff3b30;
    --found: #007aff;
    --adoption: #ff9500;
    --foster: #4cd964;
    --success: #4cd964;
    --error: #ff3b30;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    color: var(--ink);
    line-height: 1.6;
    background:
        radial-gradient(1200px 600px at 0% -10%, rgba(244, 190, 76, 0.45), transparent 60%),
        radial-gradient(600px 500px at 85% 10%, rgba(0, 122, 255, 0.18), transparent 60%),
        radial-gradient(700px 600px at 15% 85%, rgba(76, 217, 100, 0.18), transparent 65%),
        linear-gradient(180deg, #fff7df 0%, #ffffff 45%, #f7f7f7 100%);
    min-height: 100vh;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(33, 37, 41, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

header,
main,
footer {
    position: relative;
    z-index: 1;
}

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

h1,
h2,
h3 {
    font-family: "Fraunces", serif;
    color: var(--ink);
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(2.4rem, 4vw, 3.3rem);
    line-height: 1.1;
    margin: 0 0 1.1rem;
}

h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    margin: 0 0 0.9rem;
}

a {
    color: var(--found);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(0, 122, 255, 0.5);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 2000;
    background: #ffffff;
    border: 2px solid var(--found);
    color: var(--ink);
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--shadow-soft);
}

.skip-link:focus {
    top: 1rem;
}

.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 {
    background: linear-gradient(135deg, var(--brand) 0%, #ffd581 55%, var(--brand) 100%);
    border-bottom: 1px solid rgba(33, 37, 41, 0.12);
    box-shadow: 0 18px 40px rgba(33, 37, 41, 0.12);
}

.layout {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.4rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

header .layout {
    max-width: 1240px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--header-title);
    text-decoration: none;
}

.brand-logo {
    height: clamp(64px, 11vw, 100px);
    width: auto;
    filter: drop-shadow(0 12px 18px rgba(33, 37, 41, 0.16));
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand));
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    padding: 0.4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 24px rgba(33, 37, 41, 0.12);
    transition: max-height 0.25s ease;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

nav::-webkit-scrollbar {
    display: none;
}

.nav-link {
    color: var(--nav-active);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    text-decoration: none;
    padding: 0.38rem 0.66rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
    background: rgba(33, 37, 41, 0.08);
    transform: translateY(-1px);
}

.nav-link[aria-current="page"] {
    background: #ffffff;
    color: var(--nav-active);
    box-shadow: 0 8px 20px rgba(33, 37, 41, 0.15);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.85rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.8);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle-icon {
    display: inline-block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--ink);
    position: relative;
    box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink);
}

.nav-toggle:hover,
.nav-toggle:focus {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(33, 37, 41, 0.2);
}

main {
    padding: 4rem 1.25rem 5rem;
}

.hero {
    max-width: 1120px;
    margin: 0 auto 3.5rem;
    padding: clamp(2.6rem, 4vw, 3.8rem);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 32px;
    border: 1px solid rgba(33, 37, 41, 0.08);
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -100px;
    width: 260px;
    height: 260px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 59, 48, 0.4), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(0, 122, 255, 0.35), transparent 65%);
    opacity: 0.9;
    z-index: 0;
}

.hero::after {
    content: "";
    position: absolute;
    bottom: -140px;
    left: -110px;
    width: 280px;
    height: 280px;
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 149, 0, 0.38), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(76, 217, 100, 0.32), transparent 65%);
    opacity: 0.85;
    z-index: 0;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.kicker,
.hero small {
    display: block;
    margin: 0 0 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.intro,
.hero p {
    margin: 0;
    color: var(--muted);
    max-width: 700px;
    font-size: 1.05rem;
}

.muted {
    color: var(--muted);
    font-size: 0.95rem;
}

.actions,
.hero-actions,
.support-actions {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.9rem 1.9rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand));
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(244, 190, 76, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover,
.button:focus {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(244, 190, 76, 0.45);
}

.button.secondary {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid rgba(33, 37, 41, 0.2);
    box-shadow: none;
}

.button.secondary:hover,
.button.secondary:focus {
    background: linear-gradient(135deg, #ffffff, var(--brand-soft));
    border-color: rgba(33, 37, 41, 0.3);
}

.button[disabled],
button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.text-link {
    color: var(--found);
    font-weight: 600;
    text-decoration: none;
}

.text-link:hover,
.text-link:focus {
    text-decoration: underline;
}

.highlights,
.info-grid,
.grid {
    max-width: 1120px;
    margin: 0 auto 3rem;
    display: grid;
    gap: 1.6rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.highlights article,
.info-grid .card,
.grid .card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #ffffff;
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid rgba(33, 37, 41, 0.08);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.highlights article::before,
.info-grid .card::before,
.grid .card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--card-accent, var(--brand));
}

.highlights article:nth-child(1) { --card-accent: var(--lost); }
.highlights article:nth-child(2) { --card-accent: var(--found); }
.highlights article:nth-child(3) { --card-accent: var(--adoption); }

.info-grid .card:nth-child(1) { --card-accent: var(--found); }
.info-grid .card:nth-child(2) { --card-accent: var(--foster); }
.info-grid .card:nth-child(3) { --card-accent: var(--adoption); }

.grid .card:nth-child(1) { --card-accent: var(--found); }
.grid .card:nth-child(2) { --card-accent: var(--adoption); }

.highlights h2,
.card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
}

.highlights p,
.card p {
    margin: 0;
    color: var(--body-copy);
}

.support {
    max-width: 1120px;
    margin: 0 auto;
}

.support .card {
    text-align: center;
}

.support .card .button {
    align-self: center;
}

.card {
    background: #ffffff;
    padding: 2.2rem;
    border-radius: 26px;
    border: 1px solid rgba(33, 37, 41, 0.08);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.card ul,
.section ul,
.section ol {
    margin: 0 0 1.1rem 1.2rem;
    padding-left: 1rem;
    color: var(--body-copy);
}

.card li,
.section li {
    margin-bottom: 0.55rem;
}

.card li:last-child,
.section li:last-child {
    margin-bottom: 0;
}

.handle {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--ink);
}

.card-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.note {
    background: var(--surface-alt);
    padding: 1.3rem 1.5rem;
    border-radius: 18px;
    border: 1px solid rgba(33, 37, 41, 0.08);
    color: var(--muted);
    margin-top: 1.2rem;
}

main > .note,
main > section.note {
    max-width: 1120px;
    margin: 0 auto 3rem;
}

.section {
    max-width: 1120px;
    margin: 0 auto 2.6rem;
    background: #ffffff;
    padding: clamp(2rem, 3vw, 2.9rem);
    border-radius: 26px;
    border: 1px solid rgba(33, 37, 41, 0.08);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--lost), var(--found), var(--adoption), var(--foster));
}

.section p {
    margin: 0 0 1.1rem;
    color: var(--body-copy);
}

.card-inline {
    display: grid;
    gap: 1rem;
    background: var(--surface-alt);
    border-radius: 18px;
    padding: 1.5rem;
    border: 1px solid rgba(33, 37, 41, 0.08);
}

.related {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.related a,
.related span {
    color: var(--found);
    font-weight: 700;
    text-decoration: none;
}

.related a:hover,
.related a:focus {
    text-decoration: underline;
}

.request-card {
    max-width: 920px;
    margin: 0 auto;
    background: #ffffff;
    padding: clamp(2rem, 4vw, 3rem);
    border-radius: 28px;
    border: 1px solid rgba(33, 37, 41, 0.08);
    box-shadow: var(--shadow-strong);
}

.request-card h2 {
    margin: 0 0 1rem;
    font-size: 1.6rem;
}

/* Home: tighter spacing for integrated donations block */
#donaciones {
    margin-top: 3.6rem;
    margin-bottom: 2.4rem;
}

.hero--donations {
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.97), rgba(255, 250, 237, 0.96));
    border: 1px solid rgba(244, 190, 76, 0.3);
    box-shadow: 0 22px 44px rgba(231, 164, 47, 0.16);
}

.hero--donations::before {
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 149, 0, 0.28), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(244, 190, 76, 0.28), transparent 65%);
}

.hero--donations::after {
    background:
        radial-gradient(circle at 35% 35%, rgba(76, 217, 100, 0.2), transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(0, 122, 255, 0.2), transparent 65%);
}

#donaciones + .info-grid {
    margin-bottom: 2rem;
}

#donaciones + .info-grid + .note {
    margin-bottom: 1.8rem;
}

.request-card p {
    margin: 0 0 1.5rem;
    color: var(--body-copy);
}

.request-form {
    display: grid;
    gap: 1.3rem;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}

#deletion-form {
    max-width: 460px;
}

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

.row > .input-group:only-child {
    grid-column: 1 / -1;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.input-group label {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.input-group input,
.input-group select,
.input-group textarea {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(33, 37, 41, 0.2);
    font-size: 1rem;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.request-card .row {
    gap: 1.15rem;
}

.input-group input[type="file"] {
    padding: 0.62rem 0.75rem;
    border-style: dashed;
    background: rgba(255, 248, 232, 0.52);
}

.input-group input[type="file"]::file-selector-button {
    border: 1px solid rgba(33, 37, 41, 0.2);
    background: #ffffff;
    color: var(--ink);
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    margin-right: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}

.input-group textarea {
    min-height: 140px;
    resize: vertical;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--found);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.18);
}

.feedback {
    margin: 0;
    font-size: 0.95rem;
    color: var(--success);
}

.feedback.error {
    color: var(--error);
}

.map-block {
    background: var(--surface-alt);
    border: 1px solid rgba(33, 37, 41, 0.1);
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    gap: 0.65rem;
}

.map-block h3 {
    margin: 0;
    font-size: 1.08rem;
}

#commerce-map {
    width: 100%;
    height: 300px;
    border-radius: 14px;
    border: 1px solid rgba(33, 37, 41, 0.16);
    overflow: hidden;
}

.map-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.map-actions .button.secondary {
    padding: 0.7rem 1.1rem;
}

.map-status {
    margin: 0;
    color: var(--body-copy);
    font-size: 0.92rem;
}

.checkline {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.95rem;
    color: var(--body-copy);
}

.checkline input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin-top: 0.2rem;
    accent-color: var(--found);
}

.request-card .note ul {
    margin: 0.4rem 0 0 1.1rem;
    padding: 0;
}

.request-card .note li {
    margin-bottom: 0.45rem;
}

.request-card .note li:last-child {
    margin-bottom: 0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal {
    background: #ffffff;
    width: 100%;
    max-width: 520px;
    border-radius: 18px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.modal header {
    border-bottom: 1px solid var(--divider);
    padding: 1rem 1.25rem;
    background: var(--surface-alt);
    box-shadow: none;
}

.modal header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-family: "Fraunces", serif;
}

.modal .content {
    padding: 1rem 1.25rem;
    color: var(--muted);
}

.modal .actions {
    padding: 1rem 1.25rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

details.faq {
    background: var(--surface-alt);
    border: 1px solid rgba(33, 37, 41, 0.12);
    border-radius: 16px;
    padding: 0.8rem 1rem;
}

details.faq summary {
    cursor: pointer;
    font-weight: 600;
}

details.faq + details.faq {
    margin-top: 0.6rem;
}

footer {
    background: var(--footer-bg);
    border-top: 1px solid rgba(33, 37, 41, 0.1);
}

footer::before {
    content: "";
    display: block;
    height: 5px;
    background: linear-gradient(90deg, var(--brand), var(--adoption), var(--found), var(--foster));
}

footer .layout {
    flex-wrap: wrap;
    row-gap: 0.75rem;
}

footer p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}

footer a:hover,
footer a:focus {
    text-decoration: underline;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero,
.highlights article,
.info-grid .card,
.grid .card,
.section,
.request-card,
.note,
.card-inline,
.support .card {
    animation: rise 0.6s ease both;
}

.highlights article:nth-child(1) { animation-delay: 0.05s; }
.highlights article:nth-child(2) { animation-delay: 0.12s; }
.highlights article:nth-child(3) { animation-delay: 0.2s; }

.info-grid .card:nth-child(1) { animation-delay: 0.05s; }
.info-grid .card:nth-child(2) { animation-delay: 0.12s; }
.info-grid .card:nth-child(3) { animation-delay: 0.2s; }

.grid .card:nth-child(1) { animation-delay: 0.05s; }
.grid .card:nth-child(2) { animation-delay: 0.12s; }

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
        align-items: flex-start;
    }

    header .layout {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    header .nav-toggle {
        margin-left: auto;
    }

    header nav {
        flex-basis: 100%;
    }

    .nav-toggle {
        display: inline-flex;
    }

    nav {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
        max-height: 0;
        overflow: hidden;
        padding: 0;
        border-radius: 18px;
        box-shadow: none;
        background: transparent;
        border-color: transparent;
    }

    nav[data-open="true"] {
        max-height: 600px;
        padding: 0.6rem;
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(255, 255, 255, 0.6);
    }

    .hero {
        padding: 2.4rem 2rem;
    }

    .actions,
    .hero-actions,
    .support-actions {
        flex-direction: column;
        align-items: flex-start;
    }

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

@media (max-width: 640px) {
    main {
        padding: 3.2rem 1.1rem 4rem;
    }

    .hero {
        margin-bottom: 2.6rem;
    }

    .card,
    .section,
    .request-card {
        padding: 1.8rem 1.35rem;
    }

    .section {
        margin-bottom: 1.6rem;
    }

    .section p,
    .section li,
    .card p,
    .card li {
        line-height: 1.72;
    }

    .request-card .input-group {
        gap: 0.38rem;
    }

    .checkline {
        font-size: 0.9rem;
    }

    #commerce-map {
        height: 240px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
