:root {
    --primary: #6CACE4;
    --primary-dark: #2E6CB7;
    --accent: #F4D35E;
    --bg: #F4F8FC;
    --card: #FFFFFF;
    --text: #1A2E4E;
    --text-soft: #5C6B82;
    --border: #D6E3F2;
    --ok: #4CAF50;
    --err: #C0392B;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(46,108,183,0.08);
    --rama-bg: #E8F1FB;
    --figura-bg: #FFF6D9;
    --pj-bg: #DCEFE0;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary-dark);
    text-decoration: none;
    letter-spacing: 0.5px;
}
.logo span { color: var(--accent); font-weight: 700; }

.topbar nav a {
    margin-left: 1rem;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
}
.topbar nav a:hover { color: var(--primary); }

.btn-primary, button.btn-primary, a.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff !important;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    display: inline-block;
    background: #fff;
    color: var(--text);
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.2rem;
}

.hero {
    text-align: center;
    padding: 3.5rem 1rem 2.5rem;
    background: linear-gradient(180deg, #E8F1FB 0%, var(--bg) 100%);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.hero h1 {
    font-size: 3rem;
    margin: 0 0 0.4rem;
    color: var(--primary-dark);
    letter-spacing: 1px;
}
.hero h1 span { color: var(--accent); }
.hero .tagline {
    font-size: 1.4rem;
    color: var(--text);
    font-weight: 600;
    margin: 0 0 0.6rem;
}
.hero p {
    font-size: 1.05rem;
    color: var(--text-soft);
    max-width: 560px;
    margin: 0 auto 1.4rem;
}
.hero .cta { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.6rem; }
.hero-quote {
    font-style: italic;
    color: var(--primary-dark);
    font-size: 0.95rem;
    margin-top: 1rem !important;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

form.stacked label {
    display: block;
    margin: 0.8rem 0 0.3rem;
    font-size: 0.9rem;
    color: var(--text-soft);
}
form.stacked input[type=text],
form.stacked input[type=email],
form.stacked input[type=password],
form.stacked input[type=date],
form.stacked input[type=number],
form.stacked select,
form.stacked textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}
form.stacked textarea { min-height: 90px; resize: vertical; }
form.stacked .row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
form.stacked .row > * { flex: 1 1 200px; }
form.stacked button { margin-top: 1.2rem; }

.flash {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.flash.ok { background: #E8F5E9; color: #1B5E20; border: 1px solid #A5D6A7; }
.flash.err { background: #FFEBEE; color: #B71C1C; border: 1px solid #EF9A9A; }

.footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-soft);
    font-size: 0.85rem;
}

.swipe-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    max-width: 420px;
    margin: 0 auto;
}
.swipe-card .photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #eee center/cover no-repeat;
}
.swipe-card .info { padding: 1rem 1.2rem; }
.swipe-card .info h2 { margin: 0 0 0.3rem; font-size: 1.4rem; }
.swipe-card .info .meta { color: var(--text-soft); margin-bottom: 0.6rem; font-size: 0.95rem; }
.swipe-card .info .bio { font-size: 0.95rem; }
.swipe-card .info .tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0.8rem; }
.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}
.tag-rama   { background: var(--rama-bg);   color: var(--primary-dark); }
.tag-figura { background: var(--figura-bg); color: #8B6F00; }
.tag-pj     { background: var(--pj-bg);     color: #1F5C2A; }
.tag-intent { background: #F0E6F8;          color: #5B2A82; }

.swipe-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}
.swipe-actions button {
    width: 64px; height: 64px;
    border-radius: 50%;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.btn-pass { background: #fff; color: var(--err); border: 1px solid var(--border); }
.btn-like { background: var(--primary); color: #fff; }
.btn-like:hover { background: var(--primary-dark); }

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.6rem;
}
.photo-grid .thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    background: #eee center/cover no-repeat;
    overflow: hidden;
}
.photo-grid .thumb .rm {
    position: absolute; top: 4px; right: 4px;
    background: rgba(0,0,0,0.6); color: #fff;
    border: none; border-radius: 50%;
    width: 24px; height: 24px; cursor: pointer;
}

.match-list { list-style: none; padding: 0; margin: 0; }
.match-list li {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.8rem; border-bottom: 1px solid var(--border);
}
.match-list li a { text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 0.8rem; flex: 1; }
.match-list .avatar { width: 48px; height: 48px; border-radius: 50%; background: #eee center/cover no-repeat; }

.chat {
    display: flex; flex-direction: column;
    height: calc(100vh - 140px);
    max-width: 640px; margin: 0 auto;
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}
.chat .head { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); font-weight: 500; }
.chat .log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.chat .msg { max-width: 75%; padding: 0.5rem 0.8rem; border-radius: 14px; word-wrap: break-word; }
.chat .msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat .msg.them { align-self: flex-start; background: #F0F0F0; color: var(--text); border-bottom-left-radius: 4px; }
.chat form { display: flex; gap: 0.5rem; padding: 0.6rem; border-top: 1px solid var(--border); }
.chat form input { flex: 1; padding: 0.5rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); }

@media (max-width: 600px) {
    .topbar { padding: 0.6rem 0.8rem; }
    .topbar nav a { margin-left: 0.6rem; font-size: 0.85rem; }
    .hero h1 { font-size: 1.8rem; }
    .container { padding: 1rem 0.8rem; }
}
