﻿/*
 Paleta do Smart Box Unidade Centro:
 - Fundo preto profundo (#050505)
 - Destaques amarelo vivo (#ffd400) e amarelo escuro (#ffb000)
 - Textos em off-white para alto contraste
*/
:root {
    --bg-dark: #050505;
    --bg-card: #111118;
    --bg-elevated: #151522;
    --accent: #ffd400;
    --accent-dark: #ffb000;
    --accent-soft: rgba(255, 212, 0, 0.2);
    --text-light: #fdfdf6;
    --text-muted: #c5c5c5;
    --text-subtle: #9ea3b9;
    --danger: #ff4d4d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Poppins", "Segoe UI", Tahoma, sans-serif;
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 212, 0, 0.08), transparent 55%),
        linear-gradient(165deg, #101020 0%, #06060e 45%, #090b18 100%);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: 0.01em;
    line-height: 1.55;
}


.container {
    width: min(1100px, 90%);
    margin: 0 auto;
}

.call-page .container {
    width: min(1400px, 96%);
}

.top-bar {
    background: linear-gradient(180deg, #060606 0%, #111111 100%);
    border-bottom: 2px solid var(--accent);
    padding: 1.5rem 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    text-align: center;
}

.brand-logo {
    position: relative;
    display: block;
    width: clamp(160px, 18vw, 240px);
    height: auto;
    overflow: hidden;
}
.brand-logo::before,
.brand-logo::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.brand-logo::before {
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 55%);
    opacity: 0.6;
    animation: logo-pulse 6s ease-in-out infinite;
    z-index: 2;
}
.brand-logo::after {
    left: -140%;
    width: 55%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgba(255, 254, 230, 0.7) 45%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    animation: logo-sweep 4.5s cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
    z-index: 3;
}
.brand-logo-img {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
}

@keyframes logo-sweep {
    0%, 55% {
        left: -140%;
    }
    70% {
        left: 130%;
    }
    100% {
        left: 130%;
    }
}

@keyframes logo-pulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.05);
    }
}

.brand-text {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    text-align: center;
}

.brand-text h1 {
    color: var(--accent);
}

.top-bar h1 {
    font-size: clamp(1.4rem, 2vw + 0.6rem, 2.2rem);
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.subtitle {
    margin: 0;
    color: var(--text-subtle);
    font-size: 0.95rem;
    font-weight: 500;
}

.app-address {
    margin: 0;
    font-size: 0.85rem;
    font-style: italic;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
}

main.container {
    flex: 1;
    padding: 3rem 0 4rem;
}


.footer {
    background: #060606;
    border-top: 1px solid rgba(255, 212, 0, 0.25);
    padding: 1rem 0;
    text-align: center;
    color: var(--text-muted);
}

h1, h2, h3, h4 {
    font-weight: 600;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #111111;
    font-weight: 600;
    padding: 0.85rem 1.5rem;
    border-radius: 1rem;
    text-decoration: none;
    cursor: pointer;
    min-height: 3rem;
    letter-spacing: 0.02em;
    box-shadow: 0 10px 22px rgba(255, 212, 0, 0.28);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 32px rgba(255, 212, 0, 0.4);
    filter: brightness(1.05);
}

.button:active {
    transform: translateY(-1px) scale(0.99);
    filter: brightness(0.98);
    box-shadow: 0 10px 18px rgba(255, 212, 0, 0.3);
}

.button:focus-visible {
    outline: 3px solid rgba(255, 212, 0, 0.45);
    outline-offset: 2px;
}

.button.secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(255, 212, 0, 0.55);
    box-shadow: none;
}

.button.secondary:hover {
    color: #111111;
    background: var(--accent);
    box-shadow: 0 14px 24px rgba(255, 212, 0, 0.32);
}

.button.danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 10px 22px rgba(255, 77, 77, 0.25);
}

.button.small {
    padding: 0.45rem 0.95rem;
    font-size: 0.85rem;
    min-height: 2.4rem;
}

.button .button-icon {
    display: inline-flex;
    margin-right: 0.45rem;
    font-size: 1.1rem;
    line-height: 1;
}

.button .button-label {
    display: inline-flex;
    align-items: center;
}

.hidden {
    display: none !important;
}

.notice {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-subtle);
    text-align: center;
}

/* Centralizacao da pagina inicial (textos e botoes) */
.intro.center {
    text-align: center;
}

.intro {
    padding: 3rem 0 2.4rem;
    margin: 0 auto 2.5rem;
    max-width: 640px;
}

.intro h2 {
    margin: 0 0 0.85rem;
    font-size: clamp(1.8rem, 1.1rem + 1.3vw, 2.2rem);
    font-weight: 600;
}

.intro p {
    margin: 0;
    color: var(--text-subtle);
    line-height: 1.6;
    font-size: 1rem;
}

.loft-grid.centered {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.75rem 1.5rem;
    justify-items: center;
    align-items: stretch;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.loft-grid.centered .loft-card {
    width: 100%;
    max-width: 260px;
    align-items: center;
    text-align: center;
}


.loft-card {
    background: var(--bg-elevated);
    padding: 1.75rem 1.9rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 212, 0, 0.18);
    box-shadow: 0 20px 38px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    min-height: 230px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.loft-card header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.loft-icon {
    font-size: 2.45rem;
    color: var(--accent);
    filter: drop-shadow(0 12px 24px rgba(255, 212, 0, 0.28));
    transition: transform 0.25s ease, filter 0.25s ease;
    animation: loft-glow 4s ease-in-out infinite;
}

.loft-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 24px 40px rgba(255, 212, 0, 0.18);
}

.loft-card:hover .loft-icon {
    transform: translateY(-2px) scale(1.05);
    filter: drop-shadow(0 18px 32px rgba(255, 212, 0, 0.38));
}

.loft-card.is-pinging .loft-icon {
    animation: loft-bell-pop 0.6s ease;
}

.loft-card.is-pinging .button.full {
    animation: button-flash 0.6s ease;
}

@keyframes loft-glow {
    0%, 100% {
        filter: drop-shadow(0 12px 24px rgba(255, 212, 0, 0.28));
    }
    50% {
        filter: drop-shadow(0 16px 28px rgba(255, 212, 0, 0.38));
    }
}

@keyframes loft-bell-pop {
    0% {
        transform: scale(1) rotate(0deg);
        color: var(--accent);
    }
    25% {
        transform: scale(1.18) rotate(-10deg);
        color: #ffe45c;
    }
    50% {
        transform: scale(1.05) rotate(8deg);
    }
    75% {
        transform: scale(1.12) rotate(-4deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        color: var(--accent);
    }
}

@keyframes button-flash {
    0% {
        box-shadow: 0 10px 22px rgba(255, 212, 0, 0.28);
    }
    45% {
        box-shadow: 0 0 18px rgba(255, 212, 0, 0.6);
    }
    100% {
        box-shadow: 0 10px 22px rgba(255, 212, 0, 0.28);
    }
}

.loft-card.inactive {
    opacity: 0.45;
}

.button.full {
    width: 100%;
    text-align: center;
    justify-content: center;
    min-height: 3.1rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.loft-card .button.full {
    gap: 0.35rem;
}

.chat-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
}

.chat-header-actions {
    width: 100%;
    display: flex;
    justify-content: center;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    text-align: center;
}

.quick-actions {
    background: var(--bg-card);
    padding: 1.6rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-soft);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.button-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.chat-box {
    background: var(--bg-card);
    padding: 1.8rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-soft);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.messages {
    background: #0b0b0f;
    border-radius: 1rem;
    padding: 1rem;
    min-height: 250px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid rgba(255, 212, 0, 0.25);
    font-family: "Fira Mono", monospace;
    text-align: left;
}

.message {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: rgba(255, 212, 0, 0.12);
    border-radius: 0.6rem;
    border-left: 3px solid var(--accent);
}

#chat-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    width: 100%;
}

#chat-form .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

#message-input {
    flex: 1 1 280px;
    min-width: 0;
    width: auto;
    max-width: 420px;
    padding: 0.75rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 212, 0, 0.3);
    background: #050505;
    color: var(--text-light);
    text-align: left;
}

#message-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 212, 0, 0.25);
}

/* Resident action buttons below the form */
.resident-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.resident-actions .button {
    width: 100%;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.resident-actions .button .button-icon {
    font-size: 1.1rem;
}

.gate-button {
    background: #22c55e;
    border-color: #16a34a;
    color: #041307;
}

.gate-button:hover:not(:disabled),
.gate-button:focus-visible {
    background: #16a34a;
    border-color: #15803d;
    color: #ffffff;
}

.gate-button:disabled {
    cursor: not-allowed;
    background: #166534;
    border-color: #14532d;
    color: rgba(255, 255, 255, 0.75);
    opacity: 0.85;
}

.video-button {
    margin-top: 0;
    background: #2563eb;
    border-color: #1d4ed8;
    color: #e8f1ff;
}

.video-button:hover:not(:disabled),
.video-button:focus-visible {
    background: #1d4ed8;
    border-color: #1e40af;
    color: #ffffff;
}

.video-button:disabled {
    cursor: not-allowed;
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: rgba(255, 255, 255, 0.75);
    opacity: 0.85;
}

.call-status {
    background: rgba(255, 212, 0, 0.12);
    border: 1px solid rgba(255, 212, 0, 0.25);
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}

.call-status-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.call-status-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.call-timer {
    font-family: "Fira Mono", monospace;
    font-weight: 600;
    color: var(--accent);
}

.call-video {
    background: #000;
    border-radius: 0.85rem;
    min-height: 360px;
    height: min(65vh, 720px);
    border: 1px solid rgba(255, 212, 0, 0.25);
    overflow: hidden;
}

.call-wrapper {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-soft);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    display: grid;
    gap: 1.5rem;
}

.call-header {
    display: grid;
    gap: 0.6rem;
}

.call-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-input {
    flex: 1;
    min-width: 220px;
    padding: 0.65rem 0.8rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 212, 0, 0.35);
    background: #050505;
    color: var(--text-light);
}

.share-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 212, 0, 0.35);
}

.jitsi-container {
    border-radius: 0.85rem;
    overflow: hidden;
    border: 1px solid rgba(255, 212, 0, 0.25);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    background: #000;
    min-height: 420px;
    height: min(78vh, 880px);
}

.call-invite {
    border-left-color: var(--danger);
    background: rgba(255, 77, 77, 0.12);
}

.call-invite-text {
    margin: 0 0 0.35rem;
    font-weight: 600;
}

.call-invite-countdown {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.call-invite-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.message-system {
    background: rgba(255, 212, 0, 0.08);
    border-left-color: rgba(255, 212, 0, 0.35);
    color: var(--text-muted);
}

.message-morador {
    border-left-color: var(--accent);
}

.message-visitante {
    border-left-color: var(--danger);
}

.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;
}

.call-placeholder {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-soft);
    text-align: center;
    display: grid;
    gap: 1rem;
    justify-items: center;
}

.admin-actions .hint {
    color: var(--text-muted);
    margin-left: 0.75rem;
    display: inline-block;
}

.hint-link {
    color: var(--accent);
    text-decoration: underline;
}

.hint-link:hover {
    text-decoration: none;
}

/* Bloco de convite do Telegram para o sindico. */
.invite-tools {
    margin-top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.invite-link {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 212, 0, 0.35);
    background: #050505;
    color: var(--text-light);
}

.invite-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.loft-admin {
    display: grid;
    gap: 1.5rem;
}

.loft-admin-card {
    background: var(--bg-card);
    padding: 1.6rem;
    border-radius: 1rem;
    border: 1px solid var(--accent-soft);
    display: grid;
    gap: 1rem;
}

.loft-admin-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}


.loft-admin-card .address {
    margin: 0;
    color: var(--text-light);
    font-weight: 600;
}
.form-grid {
    display: grid;
    gap: 0.75rem;
}

.form-grid input {
    width: 100%;
    padding: 0.7rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 212, 0, 0.25);
    background: #050505;
    color: var(--text-light);
}

code {
    background: rgba(255, 212, 0, 0.12);
    padding: 0.2rem 0.35rem;
    border-radius: 0.35rem;
    color: var(--accent);
}

@media (max-width: 960px) {
    .container {
        width: min(92vw, 900px);
    }
    .top-bar {
        padding: 1.25rem 0 1rem;
    }
    .loft-grid.centered {
        gap: 1.25rem;
    }
}

@media (max-width: 720px) {
    .container {
        width: min(94vw, 560px);
    }
    .top-bar {
        padding: 1.1rem 0;
    }
    .brand-logo {
        width: clamp(140px, 48vw, 200px);
    }
    .brand-text {
        justify-content: center;
        text-align: center;
    }
    .subtitle, .app-address {
        width: 100%;
        text-align: center;
    }
    .intro {
        padding: 2.2rem 1.25rem 2rem;
    }
    .intro h2 {
        font-size: 1.5rem;
    }
    .intro p {
        font-size: 0.95rem;
        margin: 0 auto;
    }
    .loft-grid.centered {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.4rem;
    }
    .loft-card {
        width: min(100%, 340px);
        padding: 1.6rem 1.55rem;
        min-height: 220px;
    }
    .chat-panel {
        gap: 1.5rem;
    }
    .quick-actions, .chat-box {
        width: min(360px, 100%);
        padding: 1.5rem 1.35rem;
        text-align: left;
        align-items: stretch;
    }
    .quick-actions h3 {
        text-align: center;
    }
    #chat-form {
        gap: 0.6rem;
    }
    #chat-form .button {
        padding: 0.6rem 1.1rem;
    }
}

@media (max-width: 480px) {
    .container {
        width: min(94vw, 420px);
    }
    .top-bar {
        padding: 0.85rem 0;
    }
    .brand-logo {
        width: clamp(120px, 52vw, 170px);
    }
    .intro {
        padding: 1.8rem 0.8rem;
    }
    .intro h2 {
        font-size: 1.32rem;
    }
    .intro p {
        font-size: 0.92rem;
    }
    .loft-card {
        padding: 1.35rem 1.2rem;
        gap: 1rem;
    }
    .loft-card header {
        gap: 0.55rem;
    }
    .loft-icon {
        font-size: 2.15rem;
    }
    .quick-actions, .chat-box {
        padding: 1.25rem 1.1rem;
    }
    #chat-form {
        gap: 0.5rem;
    }
    #chat-form .button {
        padding: 0.55rem 0.95rem;
    }
    .button {
        padding: 0.6rem 1rem;
    }
}

/* Estilos para a tela de login do admin */
.admin-login {
    max-width: 420px;
    margin: 4rem auto;
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.admin-login h2 {
    margin-top: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.admin-login .error {
    color: var(--danger);
    margin-bottom: 1rem;
}
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}
.login-form label {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-weight: 500;
}
.login-form input[type="password"] {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 212, 0, 0.25);
    background-color: #08080e;
    color: var(--text-light);
}
.login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 212, 0, 0.25);
}
.login-form .button {
    align-self: flex-end;
}
}

.geo-wrapper {
    min-height: calc(100vh - 220px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1.5rem 3rem;
}

.geo-card {
    max-width: 520px;
    width: 100%;
    background: rgba(17, 17, 24, 0.92);
    border: 1px solid rgba(255, 212, 0, 0.25);
    border-radius: 18px;
    padding: 2.4rem 2rem;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.geo-status {
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-light);
}

.geo-status.error {
    color: var(--danger);
}

.geo-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.button.ghost {
    background: transparent;
    border: 1px solid rgba(255, 212, 0, 0.35);
    color: var(--accent);
}

.button.ghost:hover {
    background: rgba(255, 212, 0, 0.12);
}

.geo-hint,
.geo-warning {
    margin: 0.6rem 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.geo-warning {
    color: rgba(255, 212, 0, 0.85);
}


body.geo-page .top-bar {
    padding: 1.2rem 0;
}
body.geo-page main.container {
    width: min(520px, 92%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 0 3rem;
}
body.geo-page .geo-wrapper {
    width: 100%;
    min-height: calc(100vh - 160px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.75rem;
}
body.geo-page .geo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    text-align: center;
}
body.geo-page .geo-actions {
    width: 100%;
    justify-content: center;
}
@media (prefers-reduced-motion: reduce) {
    .button,
    .loft-card {
        transition: none !important;
    }
    .loft-card.is-pinging .loft-icon,
    .loft-card.is-pinging .button.full {
        animation: none !important;
    }
}



