/* ==========================================================================
   TeInvito Free Builder - Estilos del Constructor Frontend
   ========================================================================== */

:root {
	--tif-gold: #c5a059;
	--tif-gold-dark: #a88350;
	--tif-gold-light: #f7f1e6;
	--tif-bg: #fdfaf6;
	--tif-card-bg: #ffffff;
	--tif-text: #2c2523;
	--tif-text-muted: #736b63;
	--tif-border: #ede6dd;
	--tif-primary: #556b2f;
	--tif-font-serif: 'Cormorant Garamond', Georgia, serif;
	--tif-font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body.tif-builder-body {
	background: var(--tif-bg);
	color: var(--tif-text);
	font-family: var(--tif-font-sans);
	height: 100vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	-webkit-font-smoothing: antialiased;
}

.tif-app-container {
	display: flex;
	flex-direction: column;
	height: 100vh;
	width: 100%;
}

/* --------------------------------------------------------------------------
   Top Bar
   -------------------------------------------------------------------------- */
.tif-topbar {
	height: 64px;
	background: #ffffff;
	border-bottom: 1px solid var(--tif-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 24px;
	z-index: 100;
	flex-shrink: 0;
}

.tif-brand a {
	font-size: 20px;
	font-weight: 700;
	color: var(--tif-gold-dark);
	text-decoration: none;
	letter-spacing: 0.5px;
}
.tif-brand-sub { color: #4a403a; font-weight: 400; }
.tif-tag-free {
	background: #eef2e6;
	color: #445924;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 10px;
	margin-left: 10px;
	letter-spacing: 0.5px;
}

.tif-quota-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--tif-gold-light);
	border: 1px solid #ebd9c0;
	color: var(--tif-gold-dark);
	font-size: 12px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 20px;
}
.tif-quota-pill.tif-quota-exhausted {
	background: #fde8e8;
	border-color: #f8b4b4;
	color: #9b1c1c;
}

.tif-topbar-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.tif-mobile-view-toggle { display: none; }
.tif-toggle-btn {
	background: #f0eae1;
	border: none;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	color: #665c54;
}
.tif-toggle-btn.active {
	background: var(--tif-gold-dark);
	color: #ffffff;
}

.tif-btn-user {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #f9f7f4;
	border: 1px solid var(--tif-border);
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	color: var(--tif-text);
	text-decoration: none;
}
.tif-user-dot {
	width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
}
.tif-btn-login-trigger {
	background: var(--tif-gold-dark);
	color: #fff;
	border: none;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   Split Layout (Escritorio)
   -------------------------------------------------------------------------- */
.tif-split-layout {
	display: flex;
	flex: 1;
	overflow: hidden;
	height: calc(100vh - 64px);
}

.tif-editor-pane {
	width: 480px;
	background: #ffffff;
	border-right: 1px solid var(--tif-border);
	overflow-y: auto;
	padding: 30px 28px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
}

.tif-preview-pane {
	flex: 1;
	background: #f4efe9;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 20px;
}

/* Simulación de Smartphone */
.tif-phone-frame {
	width: 380px;
	height: calc(100vh - 110px);
	max-height: 780px;
	background: #ffffff;
	border-radius: 40px;
	box-shadow: 0 25px 60px rgba(44, 37, 35, 0.15), 0 0 0 12px #201d1c;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.tif-phone-notch {
	width: 140px;
	height: 22px;
	background: #201d1c;
	border-radius: 0 0 14px 14px;
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	z-index: 50;
}
.tif-phone-screen {
	width: 100%;
	height: 100%;
	border-radius: 32px;
	overflow: hidden;
}
.tif-phone-screen iframe {
	width: 100%;
	height: 100%;
	border: none;
}

/* --------------------------------------------------------------------------
   Stepper del Wizard
   -------------------------------------------------------------------------- */
.tif-stepper {
	display: flex;
	justify-content: space-between;
	margin-bottom: 28px;
	position: relative;
	padding-bottom: 12px;
	border-bottom: 1px solid #f2ede7;
}
.tif-step-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	cursor: pointer;
	position: relative;
	z-index: 2;
}
.tif-step-num {
	width: 28px; height: 28px;
	border-radius: 50%;
	background: #ede6df;
	color: #7a706b;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	transition: all 0.2s;
}
.tif-step-item.active .tif-step-num {
	background: var(--tif-gold-dark);
	color: #ffffff;
}
.tif-step-item.completed .tif-step-num {
	background: var(--tif-primary);
	color: #ffffff;
}
.tif-step-label {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	color: #8c827a;
	margin-top: 6px;
	letter-spacing: 0.5px;
}
.tif-step-item.active .tif-step-label {
	color: var(--tif-gold-dark);
}

/* --------------------------------------------------------------------------
   Formularios y Pasos
   -------------------------------------------------------------------------- */
.tif-step-heading {
	font-family: var(--tif-font-serif);
	font-size: 26px;
	color: var(--tif-text);
	margin-bottom: 6px;
	font-weight: 600;
}
.tif-step-sub {
	font-size: 13px;
	color: var(--tif-text-muted);
	margin-bottom: 22px;
	line-height: 1.4;
}

.tif-input-group {
	margin-bottom: 18px;
}
.tif-input-group label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #4a403a;
	margin-bottom: 6px;
}
.tif-input-group input, .tif-input-group textarea, .tif-input-group select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #ddd5cc;
	border-radius: 8px;
	font-size: 14px;
	font-family: var(--tif-font-sans);
	color: #2b2523;
	outline: none;
	transition: border-color 0.2s;
}
.tif-input-group input:focus, .tif-input-group textarea:focus {
	border-color: var(--tif-gold-dark);
}
.tif-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* --------------------------------------------------------------------------
   Subida de Fotografía
   -------------------------------------------------------------------------- */
.tif-photo-upload-zone {
	border: 2px dashed #cfc5b8;
	border-radius: 12px;
	padding: 24px;
	text-align: center;
	background: #faf8f5;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
	position: relative;
}
.tif-photo-upload-zone:hover {
	border-color: var(--tif-gold-dark);
	background: #fdfbf7;
}
.tif-upload-icon { font-size: 36px; margin-bottom: 8px; }
.tif-upload-text { font-size: 13px; color: #5a504a; margin-bottom: 4px; }
.tif-upload-hint { font-size: 11px; color: #9c928a; }

.tif-photo-preview-wrap {
	position: relative;
	display: inline-block;
	max-width: 220px;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.tif-photo-preview-wrap img {
	width: 100%; height: auto; display: block;
}
.tif-btn-remove-photo {
	position: absolute;
	top: 8px; right: 8px;
	background: rgba(0,0,0,0.7);
	color: #fff;
	border: none;
	width: 24px; height: 24px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

/* --------------------------------------------------------------------------
   Tarjetas de Plantilla (Paso 5)
   -------------------------------------------------------------------------- */
.tif-template-cards {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 24px;
}
.tif-tpl-option {
	cursor: pointer;
	position: relative;
}
.tif-tpl-option input { display: none; }
.tif-tpl-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 2px solid #ede6dd;
	border-radius: 10px;
	background: #ffffff;
	transition: all 0.2s;
}
.tif-tpl-option input:checked + .tif-tpl-card {
	border-color: var(--tif-gold-dark);
	background: #fcfaf7;
	box-shadow: 0 4px 15px rgba(168, 131, 80, 0.12);
}
.tif-tpl-palette {
	width: 44px; height: 44px; border-radius: 8px; flex-shrink: 0;
}
.tif-tpl-meta strong {
	display: block; font-size: 15px; color: #2b2523; margin-bottom: 2px;
}
.tif-tpl-meta span {
	font-size: 12px; color: #7f746d;
}

/* Features Premium Teaser */
.tif-locked-features-teaser {
	background: #1c1a18;
	color: #e6e0da;
	border-radius: 12px;
	padding: 18px;
}
.tif-teaser-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}
.tif-badge-premium {
	font-size: 11px;
	font-weight: 700;
	color: #e5c58a;
	text-transform: uppercase;
	letter-spacing: 1px;
}
.tif-teaser-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}
.tif-teaser-pill {
	background: #2b2825;
	border: 1px solid #3d3935;
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 11px;
	color: #ccc3ba;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* --------------------------------------------------------------------------
   Resumen y Confirmación (Paso 6)
   -------------------------------------------------------------------------- */
.tif-summary-box {
	background: #faf7f2;
	border: 1px solid #eadecd;
	border-radius: 10px;
	padding: 18px;
	margin-bottom: 24px;
}
.tif-summary-row {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	font-size: 13px;
	border-bottom: 1px solid #f0e7db;
}
.tif-summary-row:last-child { border-bottom: none; }
.tif-summary-row span { color: #7a7069; }
.tif-summary-row strong { color: #2b2523; font-weight: 600; }

/* --------------------------------------------------------------------------
   Botonera de Navegación
   -------------------------------------------------------------------------- */
.tif-wizard-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
	padding-top: 24px;
	border-top: 1px solid #f2ede7;
}
.tif-btn-nav-prev {
	background: none;
	border: 1px solid #d4ccc2;
	color: #665b53;
	padding: 11px 20px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}
.tif-btn-nav-next {
	background: var(--tif-gold-dark);
	color: #ffffff;
	border: none;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	margin-left: auto;
}
.tif-btn-save-final {
	background: #258523;
	color: #ffffff;
	border: none;
	padding: 13px 26px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-left: auto;
	box-shadow: 0 4px 15px rgba(37, 133, 35, 0.25);
}
.tif-btn-save-final:hover { background: #1c6b1a; }

/* --------------------------------------------------------------------------
   Responsive Móvil
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.tif-topbar { padding: 0 16px; }
	.tif-mobile-view-toggle { display: flex; gap: 4px; }
	.tif-split-layout { position: relative; }

	.tif-editor-pane {
		width: 100%;
		border-right: none;
		padding: 20px 16px;
		display: block;
	}
	.tif-preview-pane {
		display: none;
		position: absolute;
		top: 0; left: 0; width: 100%; height: 100%;
		padding: 10px;
		background: #f4efe9;
		z-index: 10;
	}
	.tif-preview-pane.tif-mobile-visible {
		display: flex;
	}
	.tif-editor-pane.tif-mobile-hidden {
		display: none;
	}
	.tif-phone-frame {
		width: 100%;
		max-width: 420px;
		height: 100%;
		max-height: none;
		border-radius: 20px;
		box-shadow: none;
		border: 1px solid #ccc;
	}
}
