:root {
    --bg-a: #111827;
    --bg-b: #312e81;
    --bg-c: #0f766e;
    --card: rgba(255, 255, 255, 0.12);
    --card-strong: rgba(255, 255, 255, 0.18);
    --border: rgba(255, 255, 255, 0.22);
    --text: #f8fafc;
    --muted: rgba(248, 250, 252, 0.72);
    --dark: #0f172a;
    --accent: #67e8f9;
    --accent-2: #a78bfa;
    --danger: #fb7185;
    --success: #86efac;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(103, 232, 249, 0.36), transparent 32rem),
        radial-gradient(circle at bottom right, rgba(167, 139, 250, 0.42), transparent 36rem),
        linear-gradient(135deg, var(--bg-a), var(--bg-b) 55%, var(--bg-c));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, black, transparent 75%);
}

.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.hero-card {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 64px);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 34px;
    background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.07));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-glow {
    position: absolute;
    width: 360px;
    height: 360px;
    right: -120px;
    top: -120px;
    border-radius: 50%;
    background: rgba(103, 232, 249, 0.24);
    filter: blur(12px);
}

.topbar,
.login-layout,
.dashboard { position: relative; z-index: 1; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 46px;
}

.brand { display: flex; align-items: center; gap: 16px; }

.brand-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 20px;
    color: var(--dark);
    background: linear-gradient(135deg, #ecfeff, #c4b5fd);
    box-shadow: 0 16px 42px rgba(103, 232, 249, .2);
}

.brand-icon svg { width: 31px; height: 31px; fill: currentColor; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.5rem, 3vw, 2.35rem); }
h2 { margin-bottom: 12px; font-size: clamp(2rem, 6vw, 4.7rem); line-height: .95; letter-spacing: -0.055em; }
h3 { margin-bottom: 6px; }

.eyebrow {
    margin-bottom: 5px;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .16em;
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 18px;
    padding: 8px 13px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    color: #ecfeff;
    background: rgba(255,255,255,.1);
    font-weight: 700;
}

.logout-link {
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 15px;
    background: rgba(255,255,255,.08);
}

.login-layout {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    gap: 38px;
    min-height: 560px;
}

.intro p:not(.status-pill) {
    max-width: 620px;
    color: var(--muted);
    font-size: 1.18rem;
    line-height: 1.7;
}

.glass-form,
.panel {
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(15, 23, 42, .42);
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    backdrop-filter: blur(14px);
}

.glass-form { padding: 26px; }

label {
    display: block;
    margin: 0 0 9px;
    color: #e0f2fe;
    font-weight: 800;
}

.input-row { display: flex; gap: 10px; }

input {
    width: 100%;
    border: 1px solid rgba(255,255,255,.23);
    border-radius: 16px;
    padding: 15px 16px;
    color: var(--text);
    outline: none;
    background: rgba(255,255,255,.10);
    font: inherit;
}

input::placeholder { color: rgba(248,250,252,.48); }
input:focus { border-color: rgba(103,232,249,.85); box-shadow: 0 0 0 4px rgba(103,232,249,.14); }

button {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    color: #08111f;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    white-space: nowrap;
}

button:hover { transform: translateY(-1px); }

.dashboard {
    display: grid;
    grid-template-columns: minmax(280px, 400px) 1fr;
    gap: 22px;
    align-items: start;
}

.panel { padding: 24px; }

.muted { color: var(--muted); line-height: 1.55; }
.add-form { display: grid; gap: 12px; margin-top: 20px; }
.primary-btn { margin-top: 6px; }

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.list-header h2 { font-size: clamp(1.75rem, 4vw, 3rem); margin-bottom: 0; }
.live-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 8px rgba(134,239,172,.14), 0 0 28px rgba(134,239,172,.9);
}

.resident-list { display: grid; gap: 14px; }

.resident-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 22px;
    background: rgba(255,255,255,.09);
}

.avatar {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    color: #0f172a;
    background: #ecfeff;
    font-weight: 1000;
    font-size: 1.35rem;
}

.resident-info h3 { font-size: 1.15rem; }
.resident-info p { margin-bottom: 4px; color: rgba(248,250,252,.82); }
.resident-info small { color: rgba(248,250,252,.55); }

.delete-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: #fff;
    background: rgba(251,113,133,.18);
    border: 1px solid rgba(251,113,133,.35);
    font-size: 1.55rem;
    line-height: 1;
}

.empty-state {
    padding: 54px 20px;
    border: 1px dashed rgba(255,255,255,.25);
    border-radius: 24px;
    text-align: center;
    color: var(--muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 10px; }

.message {
    margin: 14px 0 0;
    padding: 12px 14px;
    border-radius: 16px;
    font-weight: 750;
}
.error { color: #ffe4e6; background: rgba(251,113,133,.15); border: 1px solid rgba(251,113,133,.28); }
.success { color: #dcfce7; background: rgba(34,197,94,.15); border: 1px solid rgba(134,239,172,.28); }

@media (max-width: 820px) {
    .hero-card { padding: 20px; border-radius: 26px; }
    .topbar { margin-bottom: 28px; align-items: flex-start; }
    .login-layout, .dashboard { grid-template-columns: 1fr; min-height: auto; }
    .input-row { flex-direction: column; }
    .resident-card { grid-template-columns: auto 1fr; }
    .resident-card form { grid-column: 1 / -1; }
    .delete-btn { width: 100%; }
}
