﻿/* ===== MAPFRE Premium — Global Styles ===== */
/* Inspired by Stripe, Linear, Monday.com */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --mapfre-red: #D71920;
    --mapfre-dark-red: #B8151B;
    --mapfre-darker-red: #960F14;
    --white: #FFFFFF;
    --bg: #F8F9FB;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --border-light: #F0F1F3;
    --dark: #111827;
    --dark-gray: #111827;
    --text: #374151;
    --text-gray: #6B7280;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --medium-gray: #E5E7EB;
    --light-gray: #F8F9FB;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.06), 0 8px 10px -6px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LEGACY HEADER ===== */
header {
    background: var(--white);
    color: var(--dark);
    padding: 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; color: var(--mapfre-red); }
.logo-divider { width: 1px; height: 28px; background: var(--border); }
.logo-divider { width: 1px; height: 28px; background: var(--border); }
.logo-subtitle { font-size: 0.85rem; font-weight: 400; color: var(--text-secondary); line-height: 1.3; }
.header-date { font-size: 0.8rem; color: var(--text-muted); }

/* ===== MAIN CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 32px; }

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 28px 32px;
    margin-bottom: 20px;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); border-color: #D1D5DB; }

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    letter-spacing: -0.01em;
}
.card-header .icon {
    font-size: 1.15rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FEF2F2;
    border-radius: 10px;
}

/* ===== FORM ELEMENTS ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 8px;
}
.form-row-3 { grid-template-columns: repeat(3, 1fr); }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}
.form-group input, .form-group select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--dark);
    transition: var(--transition);
    background: var(--white);
    line-height: 1.5;
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--mapfre-red);
    box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.08);
}
.form-group input[readonly] { background: var(--bg); color: var(--text); cursor: default; }
.form-group input:disabled, .form-group select:disabled { background: var(--bg); color: var(--text-muted); cursor: not-allowed; }

.form-group .edad-display {
    padding: 10px 14px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mapfre-red);
    text-align: center;
}
.edad-error { background: #FEE2E2 !important; color: #DC2626 !important; animation: shake 0.4s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ===== TOGGLE / PLAN BUTTONS ===== */
.toggle-group { display: flex; gap: 0; margin-bottom: 5px; }
.toggle-group label { text-transform: none; letter-spacing: normal; }
.toggle-btn {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
}
.toggle-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.toggle-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.toggle-btn:not(:last-child) { border-right: none; }
.toggle-btn:hover { background: #FEF2F2; color: var(--mapfre-red); }
.toggle-btn.active { background: var(--mapfre-red); border-color: var(--mapfre-red); color: var(--white); font-weight: 600; z-index: 1; }
.toggle-btn input[type="radio"] { display: none; }

.toggle-group-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.toggle-group-plans .toggle-btn { border-radius: 0; border-right: none; font-size: 0.8rem; padding: 14px 10px; }
.toggle-group-plans .toggle-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.toggle-group-plans .toggle-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-right: 1px solid var(--border); }
.toggle-group-plans .toggle-btn.active:last-child { border-right-color: var(--mapfre-red); }
.toggle-group-plans .toggle-btn .plan-price { display: block; font-size: 0.72rem; font-weight: 400; margin-top: 3px; opacity: 0.7; }
.toggle-group-plans .toggle-btn.active .plan-price { opacity: 1; }

/* ===== SECTION LABELS ===== */
.section-label { font-size: 0.85rem; font-weight: 600; color: var(--dark); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.section-label .badge { background: var(--mapfre-red); color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; }

/* ===== INTEGRANTE ROWS ===== */
.integrante-row {
    display: grid;
    grid-template-columns: 32px 170px 1fr 80px auto auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 8px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}
.integrante-row:hover { border-color: var(--border); background: #FAFBFC; }
.integrante-row .row-number { font-size: 0.85rem; font-weight: 700; color: var(--mapfre-red); text-align: center; padding-bottom: 10px; }
.integrante-row .form-group { margin-bottom: 0; }
.integrante-row input, .integrante-row select { padding: 8px 12px; font-size: 0.85rem; }
.form-group-sm { max-width: 130px; }
.integrante-acciones { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }

/* ===== TAGS ===== */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; letter-spacing: 0.02em; }
.tag-incluido { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }
.tag-adicional { background: #FFF7ED; color: #EA580C; border: 1px solid #FED7AA; }

/* ===== ADD/REMOVE BUTTONS ===== */
.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--white);
    border: 1px dashed var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 5px;
}
.btn-add:hover { border-color: var(--mapfre-red); color: var(--mapfre-red); background: #FEF2F2; }

.btn-remove {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}
.btn-remove:hover { background: #FEF2F2; border-color: #FECACA; color: #DC2626; }

/* ===== RESULT SUMMARY ===== */
.summary-card { border: 1px solid var(--border); background: var(--white); }
.res-titulo { font-size: 1rem; font-weight: 700; color: var(--dark); text-align: center; padding: 12px 0 16px; border-bottom: 1px solid var(--border-light); margin-bottom: 16px; }
.res-seccion { margin-bottom: 12px; }
.res-subtitulo { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--border-light); }
.res-persona { font-size: 0.88rem; padding: 4px 0 4px 6px; color: var(--text); }
.res-linea { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 0.9rem; }
.res-linea span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--dark); }
.res-linea-sub { padding: 4px 0 4px 12px; font-size: 0.85rem; color: var(--text-secondary); }
.res-linea-sub span:last-child { color: #EA580C; }
.res-total { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 8px; margin-top: 12px; border-top: 2px solid var(--dark); font-size: 1.15rem; font-weight: 700; color: var(--dark); }
.res-total span:last-child { font-variant-numeric: tabular-nums; font-size: 1.25rem; color: var(--mapfre-red); }

/* ===== ACTION BUTTONS ===== */
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.btn-primary {
    padding: 12px 32px;
    background: var(--mapfre-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}
.btn-primary:hover { background: var(--mapfre-dark-red); box-shadow: 0 4px 12px rgba(215, 25, 32, 0.25); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-secondary {
    padding: 12px 32px;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
}
.btn-secondary:hover { background: var(--bg); border-color: #D1D5DB; }

/* ===== INFO BOX ===== */
.info-box {
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    margin-bottom: 18px;
    font-size: 0.84rem;
    color: #0C4A6E;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}
.info-box .info-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* ===== HIDDEN / PRINT ===== */
.hidden { display: none !important; }
.print-only { display: none; }
@media print { .print-only { display: block; } }

/* ===== FOOTER ===== */
footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 0.78rem; }
footer a { color: var(--mapfre-red); text-decoration: none; }

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== PRICE TAG ===== */
.price-tag { display: inline-block; background: var(--mapfre-red); color: white; padding: 4px 12px; border-radius: 6px; font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-content { flex-direction: column; text-align: center; gap: 8px; padding: 12px 16px; }
    .logo { flex-direction: column; gap: 6px; }
    .logo-divider { display: none; }
    .container { padding: 16px; }
    .card { padding: 20px; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }
    .toggle-group-plans { grid-template-columns: repeat(2, 1fr); }
    .toggle-group-plans .toggle-btn:nth-child(2) { border-radius: 0 var(--radius-sm) 0 0; border-right: 1px solid var(--border); }
    .toggle-group-plans .toggle-btn:nth-child(2).active { border-right-color: var(--mapfre-red); }
    .toggle-group-plans .toggle-btn:nth-child(3) { border-radius: 0 0 0 var(--radius-sm); }
    .integrante-row { grid-template-columns: 30px 1fr; }
    .integrante-acciones { grid-column: 1 / -1; justify-content: flex-start; }
    .form-group-sm { max-width: 100%; }
    .actions { flex-direction: column; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}
