/* Variáveis e Reset */
:root {
    --bg-dark: #07101a;
    --bg-red: #AC1800;
    --bg-red-bright: #d92212;
    --bg-panel: #0b1720;
    --text-white: #ffffff;
    --text-muted: #b6b6b6;
    --text-soft: #d9e2ea;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial;
    background: var(--bg-dark);
    color: var(--text-white);
    -webkit-font-smoothing: antialiased;
}

.app {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* Navbar */
.navbar {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 5%;
    gap: 15px;
    background: var(--bg-red);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app.call-screen-active .navbar {
    display: none;
}

/* Logo do Samu */
.samu-logo-img {
    width: 100px;
    height: auto;
    object-fit: contain;
}


.samu-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.samu-title {
    font-size: 1.8rem;
    font-weight: 900;
}

.samu-number {
    font-size: 1.8rem;
    font-weight: 900;
}

/* Conteúdo Principal */
.main-content {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    flex: 1;
    width: 100%;
}

.app.call-screen-active .main-content {
    min-height: 100vh;
    justify-content: center;
    gap: 0;
    padding: 24px 20px;
    background:
        radial-gradient(circle at 50% 12%, rgba(172, 24, 0, 0.22), transparent 34%),
        linear-gradient(180deg, #07101a 0%, #050b12 100%);
}

/* Bloco de Localização */
.meta-container {
    margin-top: 1rem;
    width: 100%;
    max-width: 640px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.app.call-screen-active .meta-container {
    display: none;
}

.meta-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.loc-icon {
    width: 18px;
    height: 25px;
}

.location-value {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.location-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Seção do Botão */
.hero-section {
    margin-top: 2rem;
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.app.call-screen-active .hero-section {
    flex: 1;
    max-width: 420px;
    justify-content: center;
    margin-top: 0;
}

.hidden-toggle {
    display: none;
}

/* Estilo do Botão */
.call-btn {
    margin-top: 2rem;
    --btn-w: min(72vw, 320px);
    width: var(--btn-w);
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 22px;
    background: var(--bg-red);
    color: var(--text-white);
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.call-btn:active {
    transform: scale(0.96);
}

.call-btn::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 18px;
    pointer-events: none;
    opacity: 0;
}

.call-btn::before {
    border: 2px solid rgba(255, 77, 77, 0.65);
}

.call-btn.is-calling {
    animation: callPulse 1.2s ease-in-out infinite;
}

.call-btn.is-calling::before {
    animation: callRing 1.2s ease-out infinite;
}

/* Mudança de estado quando checado */
.hidden-toggle:checked+.call-btn {
    --btn-w: min(86vw, 380px);
    width: var(--btn-w);
    min-height: 0;
    height: min(calc(100vh - 48px), 620px);
    padding: 28px 22px;
    justify-content: space-between;
    background: transparent;
    border-color: transparent;
    border-radius: 0;
    box-shadow: none;
    cursor: default;
}

.hidden-toggle:checked+.call-btn,
.hidden-toggle:checked+.call-btn.is-calling {
    animation: none;
}

.hidden-toggle:checked+.call-btn:active {
    transform: none;
}

.hidden-toggle:checked+.call-btn::before {
    display: none;
}

.hidden-toggle:checked+.call-btn.is-calling .calling-phone {
    animation: none;
}

.hidden-toggle:checked+.call-btn.is-calling .call-avatar {
    animation: avatarPulse 1.4s ease-in-out infinite;
}

/* Controle de visibilidade dos estados */
.state-on {
    display: none;
}

.hidden-toggle:checked+.call-btn .state-off {
    display: none;
}

.hidden-toggle:checked+.call-btn .state-on {
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Textos dentro do Botão */
.btn-label-small {
    font-size: 0.8rem;
    opacity: 0.8;
    letter-spacing: 1px;
}

.btn-label-large {
    font-size: 2rem;
    margin-top: 4px;
}

.status-call-text {
    min-height: 18px;
    margin-top: 18px;
    font-size: 0.82rem;
    color: var(--text-soft);
    letter-spacing: 0;
    text-transform: uppercase;
}

.calling-phone {
    width: 74px;
    height: 74px;
    margin: auto auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-red-bright);
    color: #fff;
    line-height: 1;
    box-shadow: 0 18px 36px rgba(172, 24, 0, 0.4);
}

.hangup-icon {
    width: 40px;
    height: 40px;
    fill: currentColor;
    display: block;
}

.call-avatar {
    width: 136px;
    height: 136px;
    margin-top: 10px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 24px 52px rgba(0, 0, 0, 0.35);
}

.call-avatar-logo {
    width: 104px;
    height: 104px;
    object-fit: contain;
}

.call-destination {
    margin-top: 28px;
    font-size: 2.35rem;
    font-weight: 900;
    line-height: 1.05;
}

.call-subtitle {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.call-btn.is-calling .status-call-text::after {
    content: "";
    display: inline-block;
    width: 1.2em;
    text-align: left;
    animation: callingDots 1.2s steps(4, end) infinite;
}

.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 2.2rem;
    margin-top: 12px;
    display: block;
    color: #fff;
}

.end-call-text {
    font-size: 0.82rem;
    margin-top: 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0;
}


.sirus-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 0;
    margin-top: auto;
}

.sirus-logo-img {
    width: 120px;
    height: auto;
    opacity: 0.8;
    object-fit: contain;
}

.app.call-screen-active .sirus-container,
.app.call-screen-active .main-footer {
    display: none;
}


.main-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    /* Linha sutil */
    margin-top: 10px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.6;
}

@keyframes callPulse {
    0%,
    100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 10px 36px rgba(255, 77, 77, 0.35);
    }
}

@keyframes callRing {
    0% {
        opacity: 0.85;
        transform: scale(0.94);
    }

    100% {
        opacity: 0;
        transform: scale(1.18);
    }
}

@keyframes avatarPulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.08),
            0 24px 52px rgba(0, 0, 0, 0.35);
    }

    50% {
        transform: scale(1.04);
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.12),
            0 26px 58px rgba(172, 24, 0, 0.42);
    }
}

@keyframes callingDots {
    0% {
        content: "";
    }

    25% {
        content: ".";
    }

    50% {
        content: "..";
    }

    75%,
    100% {
        content: "...";
    }
}

@media (max-height: 620px) {
    .hidden-toggle:checked+.call-btn {
        height: calc(100vh - 48px);
        padding-top: 12px;
        padding-bottom: 18px;
    }

    .call-avatar {
        width: 108px;
        height: 108px;
    }

    .call-avatar-logo {
        width: 82px;
        height: 82px;
    }

    .call-destination {
        margin-top: 18px;
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .call-btn.is-calling,
    .call-btn.is-calling::before,
    .call-btn.is-calling .status-call-text::after,
    .call-btn.is-calling .call-avatar {
        animation: none;
    }

    .call-btn.is-calling::before {
        opacity: 0.75;
    }
}
