*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --red: #e53935;
    --red-dark: #c62828;
    --red-glow: rgba(229, 57, 53, 0.35);
    --bg: #0b0e14;
    --surface: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.09);
    --text: #e8e8e8;
    --muted: #7a7f8a;
    --green: #2ecc71;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: radial-gradient(ellipse at top, #1a0505 0%, #0b0e14 55%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    /* Changed from flex-start to center so it doesn't break out */
    justify-content: center;
    padding: 20px 0;
    color: var(--text);
    overflow-x: hidden;
}

.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.onboarding-slides {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px 28px;
    text-align: center;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.slide {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: fadeSlide 0.4s ease;
}

.slide.active {
    display: flex;
}

.icon-large {
    font-size: 4rem;
    margin-bottom: 20px;
}

.slide h2 {
    font-size: 1.4rem;
    margin: 0 0 10px;
}

.slide p {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.onboarding-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 28px;
    width: 100%;
    max-width: 380px;
}

.dots {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.dot {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    transition: all 0.3s;
}

.dot.active {
    background: var(--red);
    width: 22px;
    border-radius: 4px;
}

.primary-btn {
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 8px 24px var(--red-glow);
    transition: opacity 0.2s;
}

.primary-btn:hover {
    opacity: 0.9;
}

.hidden {
    display: none !important;
}

.container {
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px 22px 24px;
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

header {
    margin-bottom: 4px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hotel-branding {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.hotel-logo {
    width: 38px;
    height: 38px;
    background: rgba(229, 57, 53, 0.12);
    border: 1px solid rgba(229, 57, 53, 0.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.hotel-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
}

.brand-label {
    font-size: 0.62rem;
    color: var(--muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
}

.status-indicator {
    font-size: 0.68rem;
    color: var(--green);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator::before {
    content: '';
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.3
    }
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

main p.instruction-line {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    margin: 0 0 24px;
}

.button-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 22px;
    position: relative;
    min-height: 220px;
    overflow: hidden;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(229, 57, 53, 0.18);
    animation: ringPulse 2.5s ease-out infinite;
}

.ring-1 {
    width: 210px;
    height: 210px;
    animation-delay: 0s;
}

.ring-2 {
    width: 255px;
    height: 255px;
    animation-delay: 0.9s;
}

@keyframes ringPulse {
    0% {
        transform: scale(0.85);
        opacity: 0.7;
    }

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

.sos-button {
    width: 158px;
    height: 158px;
    background: linear-gradient(145deg, #e53935, #b71c1c);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: 3px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 10px rgba(229, 57, 53, 0.12), 0 0 0 20px rgba(229, 57, 53, 0.06), 0 20px 50px rgba(229, 57, 53, 0.5);
    transition: transform 0.15s, box-shadow 0.15s;
}

.sos-button:hover {
    transform: scale(1.03);
    box-shadow: 0 0 0 12px rgba(229, 57, 53, 0.15), 0 0 0 24px rgba(229, 57, 53, 0.08), 0 25px 60px rgba(229, 57, 53, 0.6);
}

.sos-button:active {
    transform: scale(0.95);
}

.sos-button:disabled {
    background: #2a2d35;
    color: #555555;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.trust-indicators {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
    width: 100%;
}

.trust-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
    padding: 12px 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trust-pill:first-child {
    border-radius: 10px 0 0 10px;
}

.trust-pill:last-child {
    border-radius: 0 10px 10px 0;
}

.trust-pill .t-icon {
    font-size: 1rem;
}

#statusMessage {
    font-size: 0.88rem;
    font-weight: 500;
    min-height: 20px;
    padding: 0 10px;
    margin-top: 2px;
}

.message-default {
    color: var(--muted);
}

.message-warning {
    color: #ff7875;
}

.message-success {
    color: var(--green);
}

#offlineMenu {
    width: 100%;
    margin-bottom: 14px;
    animation: fadeSlide 0.3s ease;
}

#offlineMenu h3 {
    margin: 0 0 12px;
    color: var(--red);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.call-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 11px 14px;
    margin-bottom: 9px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.2s;
}

.call-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.security-btn {
    border-left: 3px solid #4a90d9;
}

.medical-btn {
    border-left: 3px solid var(--green);
}

.fire-btn {
    border-left: 3px solid var(--red);
}

.maint-btn {
    border-left: 3px solid #f39c12;
}

.back-btn {
    margin-top: 4px;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--muted);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.88rem;
}

/* THE FIX FOR THE LINK */
.admin-link {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #e53935;
    text-decoration: none;
    font-weight: 600;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.admin-link:hover {
    opacity: 1;
}


.sos-button:disabled {
    background: linear-gradient(145deg, #7a3030, #4a1a1a) !important;
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.1), 0 0 0 20px rgba(0, 0, 0, 0.05) !important;
    cursor: not-allowed;
    transform: none !important;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}