:root {
    --bg-color: #fdf5f5;
    --primary: #f28b9a;
    --primary-light: #fadadd;
    --text-dark: #333333;
    --text-gray: #666666;
    --white: #ffffff;
    --shadow: 0 10px 25px rgba(242, 139, 154, 0.15);
    --border-radius: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Mobile App Container */
.app-container {
    width: 100%;
    max-width: 400px;
    height: 100vh;
    max-height: 850px;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

@media (min-width: 450px) {
    .app-container {
        height: 90vh;
        border-radius: 40px;
        border: 8px solid #fff;
    }
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s ease, opacity 0.4s ease;
    background-image: radial-gradient(circle at top right, #fff0f5, var(--bg-color));
}

.screen.active {
    transform: translateX(0);
    opacity: 1;
    z-index: 10;
}

.screen.hidden {
    transform: translateX(100%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.screen.hidden-left {
    transform: translateX(-100%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

/* ================== PANTALLA 1: INICIO ================== */
.home-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 25px 20px;
}

.home-header h1 {
    font-size: 24px;
    color: var(--text-dark);
}

.avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: var(--shadow);
}

.card {
    background: var(--primary-light);
    margin: 10px 25px;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
}

.card h2 {
    color: var(--text-dark);
    font-size: 18px;
    margin-bottom: 15px;
}

.card-inner {
    background: var(--white);
    border-radius: 16px;
    padding: 25px 20px;
    border: 2px solid #fbe5e8;
    position: relative;
}

.heart-icon {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 15px;
}

.card-inner h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.card-inner p {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.6;
}

.action-buttons {
    padding: 30px 25px;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(242, 139, 154, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 139, 154, 0.5);
}

.btn-large {
    width: 100%;
    justify-content: center;
}

.mt-auto {
    margin-top: auto;
    margin-bottom: 30px;
}

.bottom-nav {
    margin-top: auto;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 20px;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.03);
}

.bottom-nav i {
    font-size: 20px;
    color: #ccc;
    cursor: pointer;
}

.bottom-nav i.active {
    color: var(--primary);
}

/* ================== PANTALLA 2: QUIZ ================== */
.quiz-header {
    display: flex;
    align-items: center;
    padding: 30px 25px 20px;
    gap: 15px;
}

.back-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
}

.quiz-content {
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.progress-bar {
    height: 6px;
    background: var(--primary-light);
    border-radius: 3px;
    margin-bottom: 40px;
    position: relative;
}

.progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 30%;
    background: var(--primary);
    border-radius: 3px;
}

.question-text {
    font-size: 22px;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.4;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 8px;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--primary-light);
    border-radius: 16px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
    background: var(--white);
}

.input-wrapper input:focus {
    border-color: var(--primary);
}

.input-wrapper i {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
}

.error-msg {
    color: #e74c3c;
    font-size: 13px;
    text-align: center;
    margin-bottom: 20px;
}

/* ================== PANTALLA 3: CHAT ================== */
.chat-header {
    display: flex;
    align-items: center;
    padding: 25px 20px;
    background: var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    gap: 15px;
}

.chat-title-group h2 {
    font-size: 18px;
    color: var(--text-dark);
}

.status-indicator {
    font-size: 12px;
    color: #2ecc71;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-block;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: var(--bg-color);
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-bot {
    align-self: flex-start;
    background: var(--white);
    color: var(--text-dark);
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.msg-user {
    align-self: flex-end;
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 5px;
    box-shadow: 0 2px 10px rgba(242, 139, 154, 0.3);
}

.chat-input-area {
    padding: 15px 20px;
    background: var(--white);
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.03);
}

.chat-input-area input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid #eee;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    background: #f9f9f9;
}

.chat-input-area input:focus {
    border-color: var(--primary-light);
    background: var(--white);
}

.send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Loader para el chat */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #ccc;
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}
