/* ====== HOME PAGE CSS ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
}

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
}

#home-app {
    position: relative;
    z-index: 10;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

.home-header {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.home-logo {
    width: 100px;
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.3));
}

/* ─ Views ─ */
.view { display: none; width: 100%; flex-direction: column; align-items: center; justify-content: center; flex: 1; }
.view.active { display: flex; }

/* ─ Select View ─ */
.home-title {
    font-family: 'Cinzel', serif;
    font-size: clamp(28px, 5vw, 52px);
    font-weight: 700;
    color: #ff0043;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 0 40px rgba(255,0,67,0.4);
    margin-bottom: 10px;
}
.home-title span {
    background: linear-gradient(135deg, #ff0043, #ff6b9d, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.home-subtitle {
    color: #ff0043;
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 40px;
    letter-spacing: 1px;
    opacity: 0.85;
}

.role-cards {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.role-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 36px 32px;
    width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.role-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 60px rgba(128,90,255,0.3);
}

.role-icon {
    font-size: 40px;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.3));
}

.role-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    color: #ff0043;
    font-weight: 600;
}

.role-card p {
    font-size: 13px;
    color: rgba(255,0,67,0.7);
    line-height: 1.5;
}

.btn-primary {
    margin-top: 8px;
    padding: 10px 28px;
    background: linear-gradient(135deg, #805ad5, #4f46e5);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px rgba(128,90,213,0.5);
}
.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(128,90,213,0.7);
}

.btn-secondary {
    padding: 10px 28px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.22); }

.code-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

#input-code {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255,255,255,0.1);
    border: 2px solid #ff0043;
    border-radius: 50px;
    color: #ff0043;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 4px;
    outline: none;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(255,0,67,0.15);
}
#input-code::placeholder { letter-spacing: 1px; font-weight: 300; font-size: 13px; color: rgba(255,0,67,0.45); }
#input-code:focus { border-color: #ff0043; box-shadow: 0 0 20px rgba(255,0,67,0.35); }

.error-msg {
    color: #ff0043;
    font-size: 12px;
    min-height: 16px;
}

/* ─ Waiting View ─ */
.waiting-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}

.waiting-logo { width: 80px; }

.waiting-card h2 {
    font-family: 'Cinzel', serif;
    color: #ff0043;
    font-size: 22px;
}

.waiting-card p {
    color: rgba(255,0,67,0.7);
    font-size: 14px;
}

.sala-code {
    font-family: 'Cinzel', serif;
    font-size: 44px;
    font-weight: 700;
    letter-spacing: 10px;
    color: #c084fc;
    text-shadow: 0 0 30px rgba(192,132,252,0.6);
    padding: 12px 24px;
    background: rgba(192,132,252,0.1);
    border-radius: 12px;
    border: 1px solid rgba(192,132,252,0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.sala-code:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(192,132,252,0.8);
}

.waiting-hint {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
}

.waiting-dots {
    display: flex;
    gap: 8px;
}
.waiting-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c084fc;
    animation: dotPulse 1.4s infinite;
}
.waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* ─ Card tabs (segundo terapeuta / observador) ─ */
.card-tabs {
    display: flex;
    gap: 6px;
    width: 100%;
    background: rgba(255,255,255,0.07);
    border-radius: 50px;
    padding: 4px;
}
.card-tab {
    flex: 1;
    padding: 7px 10px;
    border: none;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: rgba(255,0,67,0.5);
    background: transparent;
    transition: background 0.2s, color 0.2s;
    letter-spacing: 0.3px;
}
.card-tab.active {
    background: linear-gradient(135deg, #ff0043, #ff6b9d);
    color: #fff;
    box-shadow: 0 2px 10px rgba(255,0,67,0.35);
}
.card-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.card-panel.hidden { display: none !important; }

/* Observer code input mirrors patient code input */
#input-code-obs {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255,255,255,0.1);
    border: 2px solid #ff0043;
    border-radius: 50px;
    color: #ff0043;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 4px;
    outline: none;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(255,0,67,0.15);
}
#input-code-obs::placeholder { letter-spacing: 1px; font-weight: 300; font-size: 13px; color: rgba(255,0,67,0.45); }
#input-code-obs:focus { border-color: #ff0043; box-shadow: 0 0 20px rgba(255,0,67,0.35); }
