/* ============================================================
   Tenantpass.ie — Folha de estilos (responsiva, mobile-first)
   Ícones são CSS/inline-SVG (sem assets), mantendo a página leve.
   ============================================================ */

:root {
    --primary: #059669;
    --primary-dark: #047857;
    --primary-light: #d1fae5;
    --dark: #0f172a;
    --text: #1e293b;
    --muted: #64748b;
    --bg: #f6f8fb;
    --card: #ffffff;
    --border: #e2e8f0;
    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --amber: #f59e0b;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 10px 30px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, .12);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.app { flex: 1; padding-bottom: 48px; }

/* ============================ Navbar ============================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 16px; height: 64px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--dark);
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand svg { flex-shrink: 0; }
.brand em {
    font-style: normal;
    color: var(--primary);
}
.brand-text {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    list-style: none;
    flex-wrap: wrap;
}
.nav-links .nav-item { display: inline-flex; align-items: center; gap: 6px; }
.nav-links .nav-link {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text);
    font-weight: 600;
    font-size: .92rem;
}
.nav-links .nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-links .nav-link.active { background: var(--primary-light); color: var(--primary-dark); }

.nav-avatar { display: flex; align-items: center; gap: 8px; }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text);
}

@media (max-width: 760px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
        box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .nav-links .nav-link { padding: 12px; }
}

/* ============================ Botões ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
    text-decoration: none;
    line-height: 1.2;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgba(5, 150, 105, .3); }

.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-light); }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }

.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: #1e293b; }

.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 1.02rem; }

/* ============================ Cards ============================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card + .card { margin-top: 16px; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 28px 0 16px;
    flex-wrap: wrap;
}
.section-title h2 { font-size: 1.35rem; }
.section-title p { color: var(--muted); font-size: .95rem; }

/* ============================ Grid de imóveis ============================ */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 18px;
}
.property-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
}
.property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.property-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #cbd5e1, #e2e8f0);
    overflow: hidden;
}
.property-media img { width: 100%; height: 100%; object-fit: cover; }
.property-media .badge { position: absolute; top: 12px; left: 12px; }

.property-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.property-price { font-size: 1.25rem; font-weight: 800; color: var(--dark); }
.property-price small { font-weight: 600; color: var(--muted); font-size: .85rem; }
.property-title { font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.property-meta { display: flex; gap: 14px; color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.property-meta span { display: inline-flex; align-items: center; gap: 5px; }
.property-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ============================ Badges ============================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
}
.badge-success { background: #d1fae5; color: #047857; border-color: #a7f3d0; }
.badge-warn { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge-danger { background: #fee2e2; color: var(--danger); border-color: #fecaca; }
.badge-info { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }

/* ============================ Formulários ============================ */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 6px;
    color: var(--dark);
}
.form-group .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }

.input, select.input, textarea.input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: .95rem;
    color: var(--text);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, .15);
}
textarea.input { min-height: 100px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--primary); }

/* ============================ Stars ============================ */
.stars { display: inline-flex; gap: 1px; line-height: 1; color: var(--amber); font-size: 1rem; }
.stars .off { color: #cbd5e1; }
.stars-lg { font-size: 1.35rem; }

.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { display: none; }
.star-input label {
    font-size: 1.7rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: color .1s ease;
    line-height: 1;
}
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked + label,
.star-input input:checked ~ label { color: var(--amber); }

/* ============================ Avatar ============================ */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.avatar-lg { width: 96px; height: 96px; border: 3px solid #fff; box-shadow: var(--shadow); }
.avatar-md { width: 56px; height: 56px; }

/* ============================ Landing ============================ */
.hero {
    background:
        radial-gradient(900px 400px at 85% -10%, rgba(5, 150, 105, .18), transparent 60%),
        radial-gradient(700px 350px at 10% 110%, rgba(16, 185, 129, .14), transparent 60%),
        linear-gradient(180deg, #ffffff, var(--bg));
    padding: 72px 0 56px;
    text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.15; color: var(--dark); }
.hero h1 span { color: var(--primary); }
.hero p { max-width: 640px; margin: 16px auto 28px; color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 48px;
}
.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat b { font-size: 1.5rem; display: block; color: var(--primary-dark); }
.stat span { color: var(--muted); font-size: .88rem; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 28px; }
.feature { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature .ico {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light); margin-bottom: 12px;
}
.feature h3 { font-size: 1.02rem; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: .9rem; }

/* ============================ Auth / role ============================ */
.auth-wrap { max-width: 460px; margin: 48px auto; }
.auth-wrap h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-wrap .sub { color: var(--muted); margin-bottom: 22px; }

.role-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.role-card {
    text-align: center;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.role-card:hover { border-color: var(--primary); }
.role-card.selected { border-color: var(--primary); background: var(--primary-light); }
.role-card .ico { font-size: 1.6rem; margin-bottom: 6px; }
.role-card b { display: block; margin-bottom: 2px; }
.role-card small { color: var(--muted); }

.auth-switch { text-align: center; color: var(--muted); margin-top: 16px; font-size: .92rem; }

.demo-box {
    margin-top: 22px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 14px;
    background: #fbfdfd;
}
.demo-box p { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }

/* ============================ Property detail ============================ */
.back-row { margin: 20px 0 4px; }
.gallery { display: grid; gap: 10px; grid-template-columns: 2fr 1fr; }
.gallery-main {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #e2e8f0;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gallery-thumbs button {
    border: none; padding: 0; border-radius: 10px; overflow: hidden; cursor: pointer; opacity: .8;
}
.gallery-thumbs button:hover, .gallery-thumbs button.active { opacity: 1; outline: 2px solid var(--primary); outline-offset: 1px; }
.gallery-thumbs img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
@media (max-width: 700px) { .gallery { grid-template-columns: 1fr; } .gallery-thumbs { grid-template-columns: repeat(4, 1fr); } }

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: start; margin-top: 16px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.price-hero { font-size: 1.9rem; font-weight: 800; color: var(--dark); }
.detail-head h1 { font-size: 1.5rem; margin-bottom: 4px; }
.detail-address { color: var(--muted); display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }

.spec-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.spec {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}
.spec b { display: block; font-size: 1.05rem; }
.spec span { color: var(--muted); font-size: .8rem; }

.review {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}
.review:first-of-type { border-top: none; }
.review .avatar { margin-top: 2px; }
.review .r-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review .r-name { font-weight: 700; font-size: .92rem; }
.review .r-date { color: var(--muted); font-size: .8rem; }
.review .r-text { margin-top: 4px; font-size: .93rem; color: var(--text); }

/* landlord card on property */
.landlord-card { display: flex; gap: 12px; align-items: center; }
.landlord-card .info { flex: 1; min-width: 0; }
.landlord-card .info b { display: block; }
.landlord-card .info span { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 4px; }

/* ============================ Profile ============================ */
.profile-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 28px;
    flex-wrap: wrap;
}
.profile-hero .info { flex: 1; min-width: 220px; }
.profile-hero h1 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-hero .bio { color: var(--muted); margin-top: 8px; }

.contact-list { display: grid; gap: 8px; margin-top: 12px; }
.contact-list .row { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: .93rem; }

.tenant-rate-list .review { margin-top: 8px; }

/* ============================ Settings ============================ */
.settings-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; margin-top: 20px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

.status-options { display: grid; gap: 10px; }
.status-option {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s ease;
}
.status-option:hover { border-color: var(--primary); }
.status-option.selected { border-color: var(--primary); background: var(--primary-light); }
.status-option .dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--border); flex-shrink: 0;
}
.status-option.selected .dot.looking { background: var(--amber); }
.status-option.selected .dot.housed { background: var(--primary); }

.avatar-upload { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }

.side-actions { display: grid; gap: 12px; }

/* ============================ Dashboard ============================ */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 16px; }
.owner-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ============================ Notificações ============================ */
.nav-bell { position: relative; display: inline-flex; align-items: center; }
.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .6rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}
.notif-list { display: grid; }
.notif-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread .notif-body > b { color: var(--dark); }
.notif-item.unread .notif-body > b::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    margin-right: 8px;
}
.notif-body { min-width: 0; flex: 1; }

/* ============================ Toast ============================ */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 120%);
    background: var(--dark);
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: .92rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transition: transform .25s ease;
    z-index: 100;
    max-width: 90vw;
    text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ============================ Footer ============================ */
.footer {
    background: var(--dark);
    color: #94a3b8;
    padding: 28px 0;
    font-size: .88rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ============================ Misc / states ============================ */
.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
    background: #fff;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty .ico { font-size: 2rem; margin-bottom: 8px; }
.empty p { margin-bottom: 14px; }

.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }

.page-head { margin-top: 28px; }
.page-head h1 { font-size: 1.6rem; }
.page-head p { color: var(--muted); }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.thumb-item { position: relative; }
.thumb-item img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; width: 100%; }
.thumb-item button {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px;
    border: none; border-radius: 50%;
    background: rgba(15, 23, 42, .75); color: #fff;
    cursor: pointer; font-size: .8rem; line-height: 1;
}
