/**
 * AI FitCoach Pro — Estilos Minimalistas y Modernos del Frontend (Portal, Calculadora, WooCommerce y Elementor).
 */

.aifp-wrapper {
	--aifp-primary: #0f172a;
	--aifp-accent: #10b981;
	--aifp-bg: #ffffff;
	--aifp-surface: #f8fafc;
	--aifp-border: #e2e8f0;
	--aifp-text: #0f172a;
	--aifp-muted: #64748b;
	--aifp-radius: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
	color: var(--aifp-text);
	line-height: 1.55;
	max-width: 1140px;
	margin: 20px auto;
	box-sizing: border-box;
}

.aifp-wrapper *,
.aifp-wrapper *::before,
.aifp-wrapper *::after {
	box-sizing: border-box;
}

/* Cabecera del Portal */
.aifp-portal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
	background: var(--aifp-primary);
	color: #ffffff;
	padding: 22px 26px;
	border-radius: var(--aifp-radius);
	margin-bottom: 20px;
	box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.aifp-portal-user {
	display: flex;
	align-items: center;
	gap: 16px;
}

.aifp-portal-logo {
	max-height: 46px;
	width: auto;
	border-radius: 6px;
}

.aifp-portal-greeting {
	font-size: 18px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.aifp-goal-tag {
	background: var(--aifp-accent);
	color: #ffffff;
	font-size: 11.5px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 999px;
}

.aifp-portal-submeta {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.8);
	margin-top: 4px;
}

.aifp-portal-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* Botones */
.aifp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
	transition: all 0.18s ease;
	border: 1px solid transparent;
}

.aifp-btn-primary {
	background: var(--aifp-accent);
	color: #ffffff !important;
}

.aifp-btn-primary:hover {
	filter: brightness(0.93);
	transform: translateY(-1px);
}

.aifp-btn-outline {
	background: #ffffff;
	color: var(--aifp-primary) !important;
	border-color: var(--aifp-border);
}

.aifp-btn-outline:hover {
	border-color: var(--aifp-accent);
	color: var(--aifp-accent) !important;
}

.aifp-btn-lg {
	padding: 13px 24px;
	font-size: 15px;
}

/* Navegación por Pestañas */
.aifp-tabs-nav {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 6px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--aifp-border);
}

.aifp-tab-btn {
	background: transparent;
	border: none;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--aifp-muted);
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.aifp-tab-btn:hover {
	color: var(--aifp-primary);
	background: var(--aifp-surface);
}

.aifp-tab-btn.active {
	background: var(--aifp-primary);
	color: #ffffff;
}

.aifp-notif-pill {
	background: #ef4444;
	color: #ffffff;
	font-size: 11px;
	padding: 1px 7px;
	border-radius: 999px;
}

.aifp-tab-panel {
	display: none;
}

.aifp-tab-panel.active {
	display: block;
	animation: aifpFadeIn 0.2s ease;
}

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

/* Tarjetas KPI (TMB, TDEE, Calorías) */
.aifp-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.aifp-kpi-card {
	background: var(--aifp-bg);
	border: 1px solid var(--aifp-border);
	border-radius: var(--aifp-radius);
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
}

.aifp-kpi-highlight {
	border-color: var(--aifp-accent);
	background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, #ffffff 100%);
}

.aifp-kpi-label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--aifp-muted);
	font-weight: 600;
}

.aifp-kpi-value {
	font-size: 28px;
	font-weight: 800;
	color: var(--aifp-primary);
	margin: 4px 0;
}

.aifp-kpi-value small {
	font-size: 14px;
	font-weight: 600;
	color: var(--aifp-muted);
}

.aifp-kpi-foot {
	font-size: 12px;
	color: var(--aifp-muted);
}

/* Tarjetas Generales y Columnas */
.aifp-two-cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 20px;
}

.aifp-card {
	background: var(--aifp-bg);
	border: 1px solid var(--aifp-border);
	border-radius: var(--aifp-radius);
	padding: 24px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.aifp-card h3 {
	margin: 0 0 6px;
	font-size: 18px;
	color: var(--aifp-primary);
}

.aifp-muted {
	color: var(--aifp-muted);
	font-size: 13.5px;
	margin: 0 0 16px;
}

.aifp-card-header-flex {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

/* Barras de Macronutrientes */
.aifp-macro-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.aifp-macro-head {
	display: flex;
	justify-content: space-between;
	font-size: 13.5px;
	margin-bottom: 6px;
}

.aifp-progress-bar {
	height: 8px;
	background: var(--aifp-surface);
	border-radius: 999px;
	overflow: hidden;
}

.aifp-progress-bar span {
	display: block;
	height: 100%;
	border-radius: 999px;
}

/* Tracker de Hidratación */
.aifp-water-counter {
	font-size: 18px;
	font-weight: 800;
	color: #0284c7;
	background: #e0f2fe;
	padding: 6px 12px;
	border-radius: 8px;
}

.aifp-water-progress {
	height: 14px;
	background: #e0f2fe;
	border-radius: 999px;
	overflow: hidden;
	margin: 14px 0 18px;
}

.aifp-water-fill {
	height: 100%;
	background: linear-gradient(90deg, #0ea5e9, #10b981);
	transition: width 0.3s ease;
}

.aifp-water-controls {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.aifp-water-tip {
	margin-top: 14px;
	font-size: 12.5px;
	color: var(--aifp-muted);
	background: var(--aifp-surface);
	padding: 10px 12px;
	border-radius: 8px;
}

/* Plan de Alimentación */
.aifp-meals-grid {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.aifp-meal-box {
	border: 1px solid var(--aifp-border);
	border-radius: 10px;
	overflow: hidden;
}

.aifp-meal-top {
	background: var(--aifp-surface);
	padding: 12px 16px;
	border-bottom: 1px solid var(--aifp-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.aifp-meal-top h4 {
	margin: 0;
	font-size: 15px;
	color: var(--aifp-primary);
}

.aifp-meal-time {
	font-size: 12px;
	color: var(--aifp-muted);
}

.aifp-meal-macros {
	text-align: right;
	font-size: 12.5px;
}

.aifp-meal-macros strong {
	display: block;
	color: var(--aifp-accent);
	font-size: 14px;
}

.aifp-meal-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 16px;
	padding: 16px;
}

.aifp-opt-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	background: #ecfdf5;
	color: #047857;
	padding: 2px 8px;
	border-radius: 4px;
	margin-bottom: 8px;
}

.aifp-opt-alt {
	background: #eff6ff;
	color: #1d4ed8;
}

.aifp-meal-option ul,
.aifp-subcard ul {
	margin: 0;
	padding-left: 18px;
	font-size: 13.5px;
}

.aifp-meal-option li,
.aifp-subcard li {
	margin-bottom: 4px;
}

.aifp-subcard {
	background: var(--aifp-surface);
	border: 1px solid var(--aifp-border);
	border-radius: 10px;
	padding: 16px;
}

.aifp-subcard h4 {
	margin: 0 0 10px;
	font-size: 15px;
}

/* Plan de Entrenamiento */
.aifp-workout-protocols {
	background: var(--aifp-surface);
	border: 1px solid var(--aifp-border);
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 18px;
	font-size: 13.5px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.aifp-workout-day-card {
	border: 1px solid var(--aifp-border);
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 18px;
}

.aifp-workout-day-head {
	background: var(--aifp-primary);
	color: #ffffff;
	padding: 12px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.aifp-workout-day-head h4 {
	margin: 0;
	font-size: 15px;
	color: #ffffff;
}

.aifp-workout-day-head span {
	font-size: 12.5px;
	opacity: 0.85;
}

.aifp-duration-tag {
	background: rgba(255, 255, 255, 0.15);
	padding: 4px 10px;
	border-radius: 999px;
}

.aifp-table-responsive {
	overflow-x: auto;
}

.aifp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}

.aifp-table th {
	background: var(--aifp-surface);
	text-align: left;
	padding: 10px 14px;
	font-size: 11.5px;
	text-transform: uppercase;
	color: var(--aifp-muted);
	border-bottom: 1px solid var(--aifp-border);
}

.aifp-table td {
	padding: 10px 14px;
	border-bottom: 1px solid var(--aifp-border);
}

.aifp-rir-badge {
	background: #ecfdf5;
	color: #047857;
	font-weight: 700;
	font-size: 12px;
	padding: 2px 8px;
	border-radius: 4px;
}

/* Formularios */
.aifp-form-section-title {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--aifp-primary);
	border-bottom: 1px solid var(--aifp-border);
	padding-bottom: 6px;
	margin: 20px 0 14px;
}

.aifp-form-grid-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
}

.aifp-form-grid-3 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
}

.aifp-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.aifp-field label {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--aifp-primary);
}

.aifp-field input,
.aifp-field select,
.aifp-field textarea {
	padding: 10px 12px;
	border: 1px solid var(--aifp-border);
	border-radius: 8px;
	font-size: 14px;
	background: #ffffff;
	color: var(--aifp-text);
	width: 100%;
}

.aifp-field input:focus,
.aifp-field select:focus,
.aifp-field textarea:focus {
	outline: none;
	border-color: var(--aifp-accent);
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.aifp-form-feedback {
	margin-top: 12px;
	font-size: 13.5px;
	font-weight: 600;
}

/* Centro de Notificaciones */
.aifp-notif-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.aifp-notif-item {
	display: flex;
	gap: 14px;
	padding: 14px 16px;
	border: 1px solid var(--aifp-border);
	border-radius: 10px;
	background: #ffffff;
}

.aifp-notif-item.unread {
	border-left: 4px solid var(--aifp-accent);
	background: #f8fafc;
}

.aifp-notif-icon {
	font-size: 22px;
	line-height: 1;
}

.aifp-notif-body {
	flex: 1;
}

.aifp-notif-top {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 4px;
}

.aifp-notif-top span {
	font-size: 12px;
	color: var(--aifp-muted);
}

.aifp-notif-body p {
	margin: 0;
	font-size: 13.5px;
	color: var(--aifp-muted);
}

/* Badges, Estados Vacíos y Tarjeta Post-Pago WooCommerce */
.aifp-badge {
	display: inline-block;
	background: #ecfdf5;
	color: var(--aifp-accent);
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.05em;
	padding: 4px 10px;
	border-radius: 999px;
	margin-bottom: 8px;
}

.aifp-empty-state,
.aifp-portal-welcome,
.aifp-thankyou-card {
	background: #ffffff;
	border: 2px solid var(--aifp-accent);
	border-radius: var(--aifp-radius);
	padding: 28px;
	margin-bottom: 22px;
	text-align: center;
}

.aifp-thankyou-badge {
	display: inline-block;
	background: #10b981;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	margin-bottom: 10px;
}

.aifp-calc-macros-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	background: var(--aifp-surface);
	border: 1px solid var(--aifp-border);
	border-radius: 8px;
	padding: 14px;
	margin-top: 12px;
	text-align: center;
	font-size: 14px;
}
