* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #0c1317;
}

/* ====================================================
   VISTA 1: LANDING DE INVITACIÓN
==================================================== */
#landingView {
    width: 100%;
    min-height: 100vh;
    background-color: #ffffff;
    color: #111b21;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#landingView header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
}

.header-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-decoration: none;
}

.download-icon-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #25d366;
    border: 2px solid #111b21;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111b21;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    cursor: pointer;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #25d366;
    letter-spacing: -0.5px;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 26px;
    height: 24px;
    cursor: pointer;
}

.menu-line {
    width: 100%;
    height: 2.5px;
    background-color: #111b21;
    border-radius: 2px;
}

#landingView main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.avatar-container {
    width: 136px;
    height: 136px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 22px;
    background-color: #e9edef;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    position: relative;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.group-title {
    font-size: 20px;
    font-weight: 700;
    color: #202c33;
    margin-bottom: 6px;
    line-height: 1.3;
    word-break: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
}

.group-subtitle {
    font-size: 14.5px;
    color: #54656f;
    margin-bottom: 24px;
    font-weight: 400;
}

.btn-join {
    background-color: #008069;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 36px;
    border-radius: 24px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 6px rgba(0, 128, 105, 0.25);
    border: none;
    cursor: pointer;
}

.btn-join:hover {
    background-color: #017560;
}

.btn-join:active {
    transform: scale(0.98);
}

.card-divider {
    width: 80%;
    max-width: 280px;
    height: 1px;
    background-color: #e9edef;
    margin: 28px 0 18px 0;
}

.footer-note {
    font-size: 14.5px;
    color: #54656f;
    margin-bottom: 6px;
}

.footer-link {
    font-size: 14.5px;
    color: #027eb5;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer-dark {
    background-color: #0c1317;
    width: 100%;
    padding: 24px 20px 22px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid #1f2c34;
}

.footer-download-btn {
    background-color: #25d366;
    color: #111b21;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 34px;
    border-radius: 24px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, transform 0.1s ease;
    cursor: pointer;
}

.footer-download-btn:hover {
    background-color: #20ba59;
}

.footer-download-btn:active {
    transform: scale(0.98);
}

.footer-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.12);
    margin: 22px 0 18px 0;
}

.social-icons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.social-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.social-icon-circle:hover {
    border-color: #25d366;
    color: #25d366;
    transform: scale(1.06);
}

/* ====================================================
   VISTA 2: CHAT SIMULADO DE WHATSAPP
==================================================== */
#chatView {
    display: none;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: #0c1317;
    overflow: hidden;
    justify-content: center;
    align-items: center;
}

.mobile-chat-app {
    width: 100%;
    max-width: 500px;
    height: 100%;
    height: 100dvh;
    background-color: #efeae2;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
}

.chat-header {
    background-color: #008069;
    color: #ffffff;
    min-height: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    padding: env(safe-area-inset-top, 0px) 10px 0 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    z-index: 100;
    user-select: none;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
}

.back-btn {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #ccc;
    flex-shrink: 0;
}

.header-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.group-name-header {
    font-size: 15.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-status {
    font-size: 12px;
    opacity: 0.88;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.group-status.typing {
    color: #d1f4cc;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 4px;
    color: #ffffff;
    flex-shrink: 0;
}

.header-actions svg {
    cursor: pointer;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #efeae2;
    background-image: radial-gradient(#d3cbbe 1px, transparent 1px), radial-gradient(#d3cbbe 1px, #efeae2 1px);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
    scroll-behavior: smooth;
}

.system-badge-container {
    display: flex;
    justify-content: center;
    margin: 4px 0;
}

.date-badge {
    background-color: #ffffff;
    color: #54656f;
    font-size: 11.5px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 7px;
    box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
    text-transform: uppercase;
}

.encryption-badge {
    background-color: #ffeecd;
    color: #54656f;
    font-size: 11px;
    line-height: 1.35;
    padding: 6px 10px;
    border-radius: 7px;
    text-align: center;
    max-width: 90%;
    box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
    margin: 2px auto 6px auto;
}

.message {
    max-width: 86%;
    min-width: 90px;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 18px;
    color: #111b21;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
    animation: popIn 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.94) translateY(6px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.message.received {
    background-color: #ffffff;
    align-self: flex-start;
    border-top-left-radius: 0;
}

.message.sent {
    background-color: #d9fdd3;
    align-self: flex-end;
    border-top-right-radius: 0;
}

.msg-sender {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.color-1 { color: #d63384; }
.color-2 { color: #008069; }
.color-3 { color: #d97706; }
.color-4 { color: #8b5cf6; }
.color-5 { color: #0284c7; }

.msg-content {
    word-break: break-word;
}

.msg-meta {
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #667781;
    margin-top: 2px;
    margin-left: 10px;
    float: right;
}

.media-preview-box {
    position: relative;
    border-radius: 7px;
    overflow: hidden;
    margin: 3px 0 5px 0;
    cursor: pointer;
    background-color: #111b21;
    width: 100%;
    max-width: 270px;
}

.media-preview-box img {
    width: 100%;
    height: auto;
    max-height: 290px;
    object-fit: cover;
    display: block;
    filter: brightness(0.96);
    transition: transform 0.2s ease;
}

.media-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.28);
}

.play-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.badge-duration {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-bubble {
    background-color: #ffffff;
    align-self: flex-start;
    border-radius: 8px;
    border-top-left-radius: 0;
    padding: 8px 12px;
    display: none;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #8696a0;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.chat-footer {
    padding: 6px 6px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    background-color: #f0f2f5;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    flex-shrink: 0;
}

.input-box-wrapper {
    flex: 1;
    background-color: #ffffff;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    gap: 6px;
    box-shadow: 0 1px 0.5px rgba(11,20,26,.1);
    min-width: 0;
}

.input-box-wrapper input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14.5px;
    color: #111b21;
    min-width: 0;
}

.icon-btn {
    background: none;
    border: none;
    color: #54656f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    flex-shrink: 0;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.send-btn-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #008069;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.send-btn-circle:hover {
    background-color: #017560;
}

/* ====================================================
   MODAL DE BLOQUEO / TAREA (BOTTOM SHEET)
==================================================== */
.lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 20, 26, 0.35);
    backdrop-filter: blur(1.5px);
    -webkit-backdrop-filter: blur(1.5px);
    z-index: 999;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lock-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lock-bottom-sheet {
    width: 100%;
    background-color: #ffffff;
    border-radius: 24px 24px 0 0;
    padding: 20px 20px max(24px, env(safe-area-inset-bottom)) 20px;
    box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.45);
    transform: translateY(100%);
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.lock-overlay.active .lock-bottom-sheet {
    transform: translateY(0);
}

.sheet-pill-handle {
    width: 42px;
    height: 4.5px;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 14px;
}

.lock-badge-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fde8e8;
    color: #e02424;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(224, 36, 36, 0.2);
    animation: shieldPulse 1.8s infinite;
}

@keyframes shieldPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.lock-title-text {
    font-size: 18.5px;
    font-weight: 800;
    color: #111b21;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.lock-subtitle-text {
    font-size: 13.5px;
    color: #54656f;
    line-height: 1.4;
    margin-bottom: 16px;
    padding: 0 4px;
}

.verification-steps {
    width: 100%;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.03);
}

.steps-heading {
    font-size: 13.5px;
    font-weight: 700;
    color: #111b21;
    margin-bottom: 2px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-num {
    width: 24px;
    height: 24px;
    background-color: #008069;
    color: #ffffff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0, 128, 105, 0.25);
}

.step-desc {
    font-size: 13.5px;
    color: #4b5563;
    line-height: 1.35;
}

.step-desc strong {
    color: #111b21;
    font-weight: 600;
}

.unlocked-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 4px;
    color: #008069;
    font-size: 14px;
    font-weight: 700;
    background: rgba(0, 128, 105, 0.08);
    border-radius: 10px;
    border: 1px dashed #008069;
}

.share-progress-card {
    width: 100%;
    background-color: #f7f8fa;
    border: 1.5px dashed #25d366;
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #111b21;
}

.share-progress-header strong {
    color: #008069;
    font-weight: 700;
    font-size: 14px;
}

.share-progress-track {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.share-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #25d366, #008069);
    border-radius: 10px;
    transition: width 0.35s ease;
}

.btn-unlock-action {
    width: 100%;
    background: linear-gradient(135deg, #25d366, #008069);
    color: #ffffff;
    font-size: 15.5px;
    font-weight: 700;
    padding: 15px 18px;
    border-radius: 14px;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    animation: pulseUnlock 1.8s infinite;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.1s ease;
}

.btn-unlock-action:active {
    transform: scale(0.97);
}

.btn-unlock-action.completed {
    background: linear-gradient(135deg, #00a884, #008069);
    box-shadow: 0 4px 18px rgba(0, 168, 132, 0.6);
}

@keyframes pulseUnlock {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.timer-warning {
    margin-top: 12px;
    font-size: 12px;
    color: #8696a0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.timer-warning span {
    color: #e02424;
    font-weight: 700;
}

@media (max-width: 500px) {
    .mobile-chat-app {
        max-width: 100%;
        box-shadow: none;
    }
}
