/* ==============================================
   PhoneApps - Estilos compartidos
   ============================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --verde: #3d7a3d;
    --verde-oscuro: #2a5e2a;
    --verde-claro: #d4e4c8;
    --verde-fondo: #e8f0e0;
    --texto: #1a3a1a;
    --texto-suave: #555;
    --blanco: #ffffff;
    --rojo: #a94442;
    --amarillo: #f7dc6f;
    --naranja: #e67e22;
    --gris: #888;
    --radius: 16px;
    --sombra: 0 4px 20px rgba(0, 40, 0, 0.1);
}

body {
    font-family: -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(145deg, var(--verde-fondo), var(--verde-claro));
    color: var(--texto);
    min-height: 100vh;
    line-height: 1.5;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.container-narrow {
    max-width: 520px;
}

/* ==============================================
   Tipografía
   ============================================== */
h1 {
    font-size: 2rem;
    color: var(--verde-oscuro);
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    color: var(--verde-oscuro);
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* ==============================================
   Botones
   ============================================== */
.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-block;
    padding: 0.9rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: var(--verde);
    color: var(--blanco);
    box-shadow: 0 4px 12px rgba(0, 60, 0, 0.15);
}

.btn-primary:hover {
    background: var(--verde-oscuro);
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 60, 0, 0.25);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--blanco);
    color: var(--verde);
    border: 2px solid var(--verde);
}

.btn-secondary:hover {
    background: var(--verde);
    color: var(--blanco);
}

.btn-danger {
    background: var(--rojo);
    color: var(--blanco);
}

/* ==============================================
   Formularios
   ============================================== */
label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--texto);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--verde-claro);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--blanco);
    color: var(--texto);
    transition: border-color 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--verde);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button[type="submit"] {
    width: 100%;
    margin-top: 1.5rem;
}

/* ==============================================
   Mensajes
   ============================================== */
.success,
.error,
.info {
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-weight: 500;
}

.success {
    background: #e6f2e0;
    border-left: 6px solid #2a7a2a;
    color: #1a4a1a;
}

.error {
    background: #f2dede;
    border-left: 6px solid var(--rojo);
    color: var(--rojo);
}

.info {
    background: #fffbea;
    border-left: 6px solid var(--amarillo);
    color: #7d6608;
}

/* ==============================================
   Landing
   ============================================== */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
}

.hero h1 {
    font-size: 2.2rem;
    max-width: 700px;
    margin: 0 auto 1rem;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--texto-suave);
    margin-bottom: 2rem;
}

.cta-box {
    background: var(--blanco);
    padding: 2rem;
    border-radius: var(--radius);
    display: inline-block;
    box-shadow: var(--sombra);
    max-width: 500px;
}

.promesa {
    margin-top: 1rem;
    color: var(--verde);
    font-weight: 700;
    font-size: 1.05rem;
}

/* Beneficios */
.beneficios {
    padding: 3rem 0;
}

.beneficios h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    background: var(--blanco);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 2px 10px rgba(0, 40, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 40, 0, 0.12);
}

.card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
    color: var(--verde-oscuro);
}

.card p {
    color: var(--texto-suave);
    font-size: 0.95rem;
    margin: 0;
}

/* Demo */
.demo {
    text-align: center;
    padding: 3rem 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--radius);
    margin: 2rem 0;
}

/* CTA final */
.cta-final {
    text-align: center;
    padding: 3rem 0;
}

.cta-final h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

/* ==============================================
   Footer
   ============================================== */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--texto-suave);
    font-size: 0.9rem;
}

footer a {
    color: var(--verde);
    font-weight: 600;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer .copy {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--gris);
}

/* ==============================================
   Admin - Panel
   ============================================== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--blanco);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 40, 0, 0.08);
}

.stat-card .num {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--verde-oscuro);
    display: block;
}

.stat-card .label {
    font-size: 0.8rem;
    color: var(--texto-suave);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filtros {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filtros button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--verde);
    background: var(--blanco);
    color: var(--verde);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: inherit;
}

.filtros button:hover,
.filtros button.activo {
    background: var(--verde);
    color: var(--blanco);
}

/* Lista de citas */
.cita-item {
    background: var(--blanco);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.7rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 40, 0, 0.06);
    border-left: 4px solid var(--verde-claro);
    flex-wrap: wrap;
}

.cita-item.status-pending { border-left-color: var(--amarillo); }
.cita-item.status-contacted { border-left-color: var(--naranja); }
.cita-item.status-confirmed { border-left-color: var(--verde); }
.cita-item.status-converted { border-left-color: #27ae60; }
.cita-item.status-cancelled { border-left-color: var(--rojo); }
.cita-item.status-expired { border-left-color: var(--gris); }

.cita-info {
    flex: 1;
    min-width: 200px;
}

.cita-info .nombre {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--verde-oscuro);
    margin-bottom: 0.3rem;
}

.cita-info .telefono {
    font-size: 0.9rem;
    color: var(--texto-suave);
    margin-bottom: 0.5rem;
}

.cita-info .mensaje {
    font-size: 0.9rem;
    color: var(--texto-suave);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.cita-info .fecha {
    font-size: 0.75rem;
    color: var(--gris);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
}

.badge.pending { background: #fff3cd; color: #7d6608; }
.badge.contacted { background: #fdebd0; color: #7e5109; }
.badge.confirmed { background: #d4edda; color: #155724; }
.badge.converted { background: #c3e6cb; color: #0b5345; }
.badge.cancelled { background: #f8d7da; color: #721c24; }
.badge.expired { background: #e2e3e5; color: #383d41; }

.cita-acciones {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.cita-acciones button {
    padding: 0.4rem 0.7rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.2s;
    font-family: inherit;
}

.cita-acciones button:hover {
    opacity: 0.85;
}

.btn-contactar { background: var(--naranja); color: white; }
.btn-confirmar { background: var(--verde); color: white; }
.btn-convertir { background: #27ae60; color: white; }
.btn-cancelar { background: var(--rojo); color: white; }

.sin-datos {
    text-align: center;
    padding: 2rem;
    color: var(--gris);
    font-size: 1rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--texto-suave);
}

/* ==============================================
   Responsive
   ============================================== */
@media (max-width: 600px) {
    h1 { font-size: 1.5rem; }
    .hero h1 { font-size: 1.6rem; }
    .hero .subtitle { font-size: 1rem; }
    .container { padding: 1rem; }
    .cta-box { padding: 1.5rem; }
    .cita-item { flex-direction: column; }
    .cita-acciones { width: 100%; }
    .cita-acciones button { flex: 1; }
}