/* ============================================================
   ABRAÇA PATAS — Design System "Acolhedor & Emocional" v2.0
   Paleta quente, tipografia expressiva, microinterações suaves.
   As variáveis abaixo alimentam também o HTML gerado pelo JS.
   ============================================================ */

:root {
    /* Cores de marca (usadas inline pelo JS — não renomear) */
    --cor-principal: #2A9D8F;
    --cor-principal-dark: #1D7268;
    --cor-secundaria: #EE7444;
    --cor-fundo: #FFF9F2;
    --cor-texto: #4A403A;

    /* Extensões da paleta */
    --cor-secundaria-dark: #D95D2E;
    --peach: #FFE8D6;
    --peach-soft: #FFF1E4;
    --rosa: #FFDACB;
    --amarelo: #F9C74F;
    --marrom: #3E2C26;
    --creme: #FFF9F2;

    /* Sombra e raio padrão */
    --sombra-suave: 0 6px 24px -8px rgba(62, 44, 38, 0.12);
    --sombra-hover: 0 18px 40px -12px rgba(238, 116, 68, 0.28);
    --raio: 1.25rem;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', 'Inter', sans-serif;
    background-color: var(--cor-fundo);
    color: var(--cor-texto);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display {
    font-family: 'Fraunces', Georgia, serif;
    letter-spacing: -0.01em;
}

::selection {
    background: var(--rosa);
    color: var(--marrom);
}

/* ---------- Cartões base (usados também pelo JS) ---------- */

.card-base {
    background-color: #FFFFFF;
    border-radius: var(--raio);
    border: 1px solid rgba(238, 116, 68, 0.08);
    box-shadow: var(--sombra-suave);
}

.pet-card {
    background-color: white;
    border-radius: var(--raio);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(.2, .9, .3, 1.2), box-shadow 0.35s ease;
}

.pet-card:hover {
    transform: translateY(-8px) rotate(-0.4deg);
    box-shadow: var(--sombra-hover);
}

.pet-card img {
    transition: transform 0.6s ease;
}

.pet-card:hover img {
    transform: scale(1.05);
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.patinha-icon {
    width: 1.1rem;
    height: 1.1rem;
    display: inline-block;
    fill: currentColor;
}

/* Botão dos cards de pet (gerado pelo JS) */
.view-details-btn {
    border-radius: 9999px !important;
    font-weight: 700 !important;
    box-shadow: 0 6px 16px -6px rgba(238, 116, 68, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease !important;
}

.view-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -6px rgba(238, 116, 68, 0.55);
}

/* ---------- Modais ---------- */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow: auto;
    background-color: rgba(62, 44, 38, 0.55);
    backdrop-filter: blur(6px);
    padding: 1.5rem 0.75rem;
    align-items: center;
    justify-content: center;
}

.modal-content {
    margin: auto;
    padding: 1.75rem;
    width: 92%;
    max-width: 700px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 1.5rem;
    animation: modalIn 0.35s cubic-bezier(.2, .9, .3, 1.15);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.close-button {
    color: #b3a49c;
    position: absolute;
    top: 0.75rem;
    right: 1.1rem;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    z-index: 5;
}

.close-button:hover {
    color: var(--cor-secundaria);
    transform: rotate(90deg);
}

/* Inputs dentro de modais e filtros */
.modal-content input[type="text"],
.modal-content input[type="email"],
.modal-content input[type="password"],
.modal-content input[type="date"],
.modal-content select,
.modal-content textarea,
.filter-card input[type="text"],
.filter-card input[type="date"],
.filter-card select {
    border-radius: 0.85rem !important;
    border: 1.5px solid #EFE3D8 !important;
    background: #FFFDFA;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus,
.filter-card input:focus,
.filter-card select:focus {
    outline: none;
    border-color: var(--cor-secundaria) !important;
    box-shadow: 0 0 0 4px rgba(238, 116, 68, 0.15);
}

/* Botões de modal (gerados pelo JS com rounded simples) */
.modal-content button {
    border-radius: 0.85rem;
    font-weight: 700;
    transition: transform 0.15s ease, opacity 0.2s, box-shadow 0.2s;
}

.modal-content button:hover:not(:disabled) {
    transform: translateY(-1px);
}

/* ---------- Header ---------- */

.header-logo {
    max-height: 52px;
    width: auto;
    border-radius: 12px;
}

.site-header {
    background: rgba(255, 249, 242, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(238, 116, 68, 0.12);
}

.nav-link {
    position: relative;
    font-weight: 600;
    color: #6B5B52;
    transition: color 0.2s;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.35rem;
    height: 2.5px;
    border-radius: 2px;
    background: var(--cor-secundaria);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-link:hover {
    color: var(--cor-secundaria-dark);
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* ---------- Botões de destaque ---------- */

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, var(--cor-secundaria) 0%, var(--cor-secundaria-dark) 100%);
    color: #fff;
    font-weight: 800;
    padding: 1rem 2.2rem;
    border-radius: 9999px;
    font-size: 1.1rem;
    box-shadow: 0 12px 28px -8px rgba(238, 116, 68, 0.55);
    transition: transform 0.2s cubic-bezier(.2, .9, .3, 1.4), box-shadow 0.25s ease;
}

.btn-cta:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 18px 36px -8px rgba(238, 116, 68, 0.6);
}

.btn-cta:active {
    transform: translateY(-1px) scale(0.99);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    padding: 1rem 1.9rem;
    border-radius: 9999px;
    color: var(--cor-principal-dark);
    border: 2px solid rgba(42, 157, 143, 0.35);
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    border-color: var(--cor-principal);
    background: #fff;
    transform: translateY(-2px);
}

/* ---------- Hero ---------- */

.hero-warm {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(60rem 30rem at 115% -10%, rgba(249, 199, 79, 0.25), transparent 60%),
        radial-gradient(50rem 28rem at -15% 110%, rgba(42, 157, 143, 0.14), transparent 60%),
        linear-gradient(180deg, #FFF3E6 0%, var(--cor-fundo) 100%);
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    pointer-events: none;
}

.hero-photo-main {
    border-radius: 2rem;
    box-shadow: 0 30px 60px -20px rgba(62, 44, 38, 0.35);
    object-fit: cover;
    width: 100%;
    aspect-ratio: 4 / 5;
    transform: rotate(1.5deg);
    transition: transform 0.5s ease;
}

.hero-photo-main:hover {
    transform: rotate(0deg) scale(1.01);
}

.hero-photo-small {
    border-radius: 1.25rem;
    box-shadow: 0 18px 36px -14px rgba(62, 44, 38, 0.35);
    object-fit: cover;
    border: 5px solid #fff;
}

.float-badge {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    box-shadow: 0 14px 30px -10px rgba(62, 44, 38, 0.25);
    animation: floaty 4.5s ease-in-out infinite;
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.heartbeat {
    display: inline-block;
    animation: heartbeat 1.8s ease-in-out infinite;
    transform-origin: center;
}

@keyframes heartbeat {
    0%, 40%, 80%, 100% { transform: scale(1); }
    10% { transform: scale(1.18); }
    20% { transform: scale(1.06); }
}

.hero-highlight {
    position: relative;
    white-space: nowrap;
    color: var(--cor-secundaria-dark);
}

.hero-highlight svg {
    position: absolute;
    left: 0;
    bottom: -0.35em;
    width: 100%;
    height: 0.4em;
}

/* ---------- Seção Como Funciona ---------- */

.step-card {
    background: #fff;
    border-radius: 1.5rem;
    padding: 2.25rem 1.75rem;
    text-align: center;
    position: relative;
    border: 1px solid rgba(238, 116, 68, 0.1);
    box-shadow: var(--sombra-suave);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--sombra-hover);
}

.step-num {
    position: absolute;
    top: -1.1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--marrom);
    color: var(--amarelo);
    font-family: 'Fraunces', serif;
    font-weight: 700;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 6px 14px -4px rgba(62, 44, 38, 0.4);
}

.step-icon {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1.25rem;
    border-radius: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transform: rotate(-4deg);
    transition: transform 0.3s ease;
}

.step-card:hover .step-icon {
    transform: rotate(4deg) scale(1.08);
}

.step-icon.warm { background: var(--peach); color: var(--cor-secundaria-dark); }
.step-icon.teal { background: #DDF2EF; color: var(--cor-principal-dark); }
.step-icon.sun  { background: #FDF0D5; color: #C98803; }

/* ---------- Área de resultados dos pets ---------- */

/* Altura mínima reservada: filtrar não encolhe a página nem "derruba" o scroll */
.pets-results {
    min-height: 70vh;
    overflow-anchor: none;
}

/* ---------- Filtros ---------- */

.filter-card {
    border-radius: 1.5rem;
}

.filter-card label {
    font-weight: 700;
    color: #7A6A60;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--peach), var(--rosa));
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cor-secundaria);
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(238, 116, 68, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cor-secundaria);
    border: 3px solid #fff;
    box-shadow: 0 3px 8px rgba(238, 116, 68, 0.45);
    cursor: pointer;
}

.range-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    height: 1.9rem;
    border-radius: 9999px;
    background: var(--peach);
    color: var(--cor-secundaria-dark) !important;
    font-weight: 800;
}

/* ---------- Interações e botões auxiliares ---------- */

.interaction-button {
    background-color: var(--cor-principal);
    color: white;
    padding: 0.6rem 1.1rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: background-color 0.2s, transform 0.15s;
    margin: 0.25rem;
}

.interaction-button:hover {
    background-color: var(--cor-principal-dark);
    transform: translateY(-1px);
}

/* ---------- Loading ---------- */

#loading-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(255, 249, 242, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 7px solid var(--peach);
    border-top: 7px solid var(--cor-secundaria);
    border-radius: 50%;
    width: 58px;
    height: 58px;
    animation: spin 0.9s linear infinite;
}

#loading-text {
    margin-top: 1rem;
    font-weight: 700;
    color: var(--cor-secundaria-dark);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ---------- FAB ---------- */

.add-pet-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, var(--cor-secundaria), var(--cor-secundaria-dark));
    color: white;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    box-shadow: 0 12px 28px -6px rgba(238, 116, 68, 0.6);
    transition: transform 0.25s cubic-bezier(.2, .9, .3, 1.5);
    cursor: pointer;
    z-index: 900;
}

.add-pet-fab:hover {
    transform: scale(1.12) rotate(90deg);
}

/* ---------- Diário ---------- */

.diary-entry {
    border-bottom: 1px dashed #EBDCCE;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
}

.diary-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.diary-author {
    font-weight: 700;
    color: var(--cor-principal-dark);
}

.diary-date {
    font-size: 0.75rem;
    color: #A08F84;
}

/* ---------- Stories ---------- */

.stories-container {
    display: flex;
    gap: 1.1rem;
    padding: 1rem 0.25rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    scrollbar-width: thin;
}

.story-item {
    text-align: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.story-item:hover {
    transform: translateY(-3px);
}

.story-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    padding: 3px;
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, var(--amarelo), var(--cor-secundaria), #E85D75) border-box;
    border: 3px solid transparent;
}

.story-name {
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 0.35rem;
    color: #6B5B52;
}

/* ---------- Visualizador de Stories (estilo Instagram) ---------- */

.story-viewer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(24, 14, 9, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.story-viewer.open {
    display: flex;
}

.story-frame {
    position: relative;
    width: min(420px, 94vw);
    height: min(86vh, 745px);
    border-radius: 1.4rem;
    overflow: hidden;
    background: #241611;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
    animation: storyIn 0.3s cubic-bezier(.2, .9, .3, 1.2);
}

@keyframes storyIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.story-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-noimg {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--cor-secundaria), #C2410C 60%, var(--marrom));
}

.story-shade-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 110px;
    background: linear-gradient(rgba(0, 0, 0, 0.65), transparent);
    z-index: 2;
    pointer-events: none;
}

.story-progress-row {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 5px;
    z-index: 5;
}

.story-progress {
    flex: 1;
    height: 3px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.32);
    overflow: hidden;
}

.story-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: #fff;
    border-radius: 99px;
}

.story-progress.done i {
    width: 100%;
}

.story-progress.active i {
    animation: storyFill var(--story-dur, 5s) linear forwards;
}

@keyframes storyFill {
    from { width: 0; }
    to   { width: 100%; }
}

.story-head {
    position: absolute;
    top: 26px;
    left: 14px;
    right: 52px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    z-index: 5;
    color: #fff;
}

.story-head img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.story-author {
    font-weight: 800;
    font-size: 0.92rem;
    line-height: 1.1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.story-time {
    font-size: 0.75rem;
    opacity: 0.85;
}

.story-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3rem 1.3rem 1.5rem;
    color: #fff;
    z-index: 4;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    font-weight: 600;
    font-size: 0.98rem;
    line-height: 1.45;
    max-height: 45%;
    overflow-y: auto;
    pointer-events: none;
}

.story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 3;
    background: transparent;
    border: none;
    cursor: pointer;
}

.story-nav-prev { left: 0; width: 34%; }
.story-nav-next { right: 0; width: 66%; }

.story-close {
    position: fixed;
    top: 1rem;
    right: 1.25rem;
    z-index: 1200;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s, transform 0.2s;
}

.story-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

@media (max-width: 480px) {
    .story-frame {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }
}

/* ---------- Feed social ---------- */

.social-post-card {
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    transition: box-shadow 0.3s ease;
}

.social-post-card:hover {
    box-shadow: var(--sombra-hover);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.85rem;
    border: 2.5px solid var(--peach);
}

.post-image {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.post-actions {
    display: flex;
    align-items: center;
}

.abracar-btn-social {
    background-color: transparent;
    border: 2px solid var(--cor-secundaria);
    color: var(--cor-secundaria);
    padding: 0.5rem 1.15rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: all 0.25s cubic-bezier(.2, .9, .3, 1.4);
}

.abracar-btn-social:hover {
    transform: scale(1.05);
}

.abracar-btn-social:hover,
.abracar-btn-social.abracado {
    background: linear-gradient(135deg, var(--cor-secundaria), var(--cor-secundaria-dark));
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 18px -6px rgba(238, 116, 68, 0.5);
}

.abracar-btn-social.abracado i {
    animation: heartbeat 1.2s ease-in-out;
}

/* ---------- Reservas ---------- */

.reserva-item {
    background-color: var(--peach-soft);
    padding: 0.8rem;
    border-radius: 0.85rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-aprovacao {
    background-color: #FDF0D5;
    color: #92610E;
}

.status-aprovada {
    background-color: #DFF3E9;
    color: #14684B;
}

.status-recusada {
    background-color: #FDECEA;
    color: #B3261E;
}

.status-concluida {
    background-color: #E4E9F2;
    color: #3B4A6B;
}

/* ---------- Botão IA ---------- */

.btn-ia {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: white;
    box-shadow: 0 6px 14px -5px rgba(139, 92, 246, 0.5);
}

.btn-ia:hover {
    background: linear-gradient(135deg, #7C3AED, #5B21B6);
}

.btn-ia:disabled {
    background: #C4B5FD;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---------- Rodapé ---------- */

.footer-warm {
    background: var(--marrom);
    color: #E8DCD2;
}

.footer-warm a {
    color: #E8DCD2;
    transition: color 0.2s;
}

.footer-warm a:hover {
    color: var(--amarelo);
}

/* ---------- Revelação ao rolar (progressiva, sem quebrar sem JS) ---------- */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .9, .3, 1);
}

.reveal.in {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Acessibilidade ---------- */

:focus-visible {
    outline: 3px solid rgba(238, 116, 68, 0.55);
    outline-offset: 2px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
}
