/**
 * Titan PQRS - Frontend Stylesheet
 * Brand: Manufacturas de Cemento S.A. (Titán)
 */

:root {
	--tpqrs-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	--tpqrs-primary: #0089F7;
	--tpqrs-primary-hover: #0070c9;
	--tpqrs-primary-light: #e0f2fe;
	--tpqrs-dark: #0f172a;
	--tpqrs-slate: #334155;
	--tpqrs-muted: #64748b;
	--tpqrs-border: #e2e8f0;
	--tpqrs-bg-light: #f8fafc;
	--tpqrs-white: #ffffff;
	--tpqrs-success: #059669;
	--tpqrs-error: #ef4444;
	--tpqrs-btn-text: #ffffff;
	--tpqrs-radius: 8px;
	--tpqrs-label-size: 14px;
	--tpqrs-label-weight: 600;
	--tpqrs-label-color: #334155;
	--tpqrs-sec-size: 20px;
	--tpqrs-sec-weight: 700;
	--tpqrs-sec-color: #0f172a;
}

/* Base Wrapper */
.titan-pqrs-wrapper {
	font-family: var(--tpqrs-font);
	color: var(--tpqrs-slate);
	width: 100%;
	max-width: 900px;
	margin: 20px auto;
	box-sizing: border-box;
}

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

.titan-pqrs-container {
	background: var(--tpqrs-white);
	border: 1px solid var(--tpqrs-border);
	border-radius: calc(var(--tpqrs-radius) + 4px);
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
	padding: 35px 40px;
	position: relative;
	overflow: hidden;
}

/* Header */
.titan-form-header {
	text-align: center;
	margin-bottom: 30px;
}

.titan-form-title {
	font-size: 26px;
	font-weight: 700;
	color: var(--tpqrs-dark);
	margin: 0 0 10px 0;
	line-height: 1.3;
}

.titan-form-subtitle {
	font-size: 14px;
	color: var(--tpqrs-muted);
	margin: 0 auto;
	max-width: 700px;
	line-height: 1.5;
}

/* Stepper & Progress Bar */
.titan-progress-wrapper {
	margin-bottom: 35px;
}

.titan-progress-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 600;
}

.titan-step-text {
	color: var(--tpqrs-primary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.titan-step-percentage {
	color: var(--tpqrs-muted);
}

.titan-progress-bar-bg {
	width: 100%;
	height: 8px;
	background: #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
	position: relative;
}

.titan-progress-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--tpqrs-primary) 0%, #38bdf8 100%);
	border-radius: 999px;
	transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stepper Dots */
.titan-stepper-dots {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-top: 15px;
	position: relative;
}

.titan-step-dot {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	text-align: center;
	cursor: default;
	position: relative;
}

.titan-step-dot::before {
	content: '';
	position: absolute;
	top: 14px;
	left: -50%;
	width: 100%;
	height: 2px;
	background: #e2e8f0;
	z-index: 1;
}

.titan-step-dot:first-child::before {
	display: none;
}

.titan-dot-number {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--tpqrs-white);
	border: 2px solid #cbd5e1;
	color: #64748b;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	position: relative;
	z-index: 2;
	transition: all 0.3s ease;
}

.titan-dot-label {
	font-size: 11px;
	color: var(--tpqrs-muted);
	margin-top: 6px;
	max-width: 100px;
	line-height: 1.2;
	display: block;
}

.titan-step-dot.active .titan-dot-number {
	background: var(--tpqrs-primary);
	border-color: var(--tpqrs-primary);
	color: #ffffff;
	box-shadow: 0 0 0 4px var(--tpqrs-primary-light);
}

.titan-step-dot.active .titan-dot-label {
	color: var(--tpqrs-primary);
	font-weight: 600;
}

.titan-step-dot.completed .titan-dot-number {
	background: var(--tpqrs-success);
	border-color: var(--tpqrs-success);
	color: #ffffff;
}

.titan-step-dot.completed::before {
	background: var(--tpqrs-success);
}

/* Sections */
.titan-form-section {
	display: none;
	animation: titanFadeIn 0.35s ease forwards;
}

.titan-form-section.active {
	display: block;
}

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

.titan-section-header {
	margin-bottom: 25px;
	padding-bottom: 12px;
	border-bottom: 2px solid #f1f5f9;
}

.titan-section-title {
	font-size: var(--tpqrs-sec-size);
	font-weight: var(--tpqrs-sec-weight);
	color: var(--tpqrs-sec-color);
	margin: 0 0 6px 0;
}

.titan-section-desc {
	font-size: 14px;
	color: var(--tpqrs-muted);
	margin: 0;
	line-height: 1.4;
}

/* Fields Grid */
.titan-fields-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	width: 100%;
	box-sizing: border-box;
}

.titan-field-wrapper {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.titan-field-wrapper.col-50 {
	flex: 0 0 calc(50% - 10px) !important;
	width: calc(50% - 10px) !important;
	max-width: calc(50% - 10px) !important;
}

.titan-field-wrapper.col-100 {
	flex: 0 0 100% !important;
	width: 100% !important;
	max-width: 100% !important;
}

.titan-field-wrapper.field-hidden {
	display: none !important;
}

.titan-label {
	font-size: var(--tpqrs-label-size);
	font-weight: var(--tpqrs-label-weight);
	color: var(--tpqrs-label-color);
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	gap: 4px;
}

.titan-required-star {
	color: var(--tpqrs-error);
	font-weight: 700;
}

/* Form Inputs - Strict override against theme constraints */
.titan-pqrs-container input[type="text"],
.titan-pqrs-container input[type="number"],
.titan-pqrs-container input[type="email"],
.titan-pqrs-container input[type="tel"],
.titan-pqrs-container input[type="date"],
.titan-pqrs-container select,
.titan-pqrs-container textarea,
.titan-input,
.titan-textarea,
.titan-select {
	width: 100% !important;
	max-width: 100% !important;
	padding: 12px 14px !important;
	font-family: inherit !important;
	font-size: 14px !important;
	color: var(--tpqrs-dark) !important;
	background: #ffffff !important;
	border: 1px solid var(--tpqrs-border) !important;
	border-radius: var(--tpqrs-radius) !important;
	outline: none !important;
	transition: all 0.2s ease !important;
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
	box-sizing: border-box !important;
	height: auto !important;
	margin: 0 !important;
	display: block !important;
}

.titan-select-wrap {
	width: 100% !important;
	max-width: 100% !important;
	position: relative;
}

.titan-input:hover,
.titan-textarea:hover,
.titan-select:hover {
	border-color: #cbd5e1;
}

.titan-input:focus,
.titan-textarea:focus,
.titan-select:focus {
	border-color: var(--tpqrs-primary);
	box-shadow: 0 0 0 3px rgba(0, 137, 247, 0.15);
}

.titan-field-wrapper.has-error .titan-input,
.titan-field-wrapper.has-error .titan-textarea,
.titan-field-wrapper.has-error .titan-select {
	border-color: var(--tpqrs-error);
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.titan-field-error {
	color: var(--tpqrs-error);
	font-size: 12px;
	font-weight: 500;
	margin-top: 6px;
	line-height: 1.3;
}

.titan-textarea {
	resize: vertical;
	min-height: 100px;
}

.titan-select-wrap {
	position: relative;
}

.titan-select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
	background-repeat: no-repeat;
	background-position: right 14px top 50%;
	background-size: 10px auto;
	padding-right: 36px;
	cursor: pointer;
}

/* Radio Group / Visual Cards */
.titan-radio-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
}

.titan-radio-card {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 18px;
	border: 1px solid var(--tpqrs-border);
	border-radius: var(--tpqrs-radius);
	background: #ffffff;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
}

.titan-radio-card:hover {
	border-color: #94a3b8;
	background: var(--tpqrs-bg-light);
}

.titan-radio-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.titan-radio-pill {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid #94a3b8;
	margin-top: 2px;
	flex-shrink: 0;
	position: relative;
	transition: all 0.2s ease;
}

.titan-radio-card.selected,
.titan-radio-card:has(.titan-radio-input:checked) {
	border-color: var(--tpqrs-primary);
	background: #f0f7ff;
	box-shadow: 0 0 0 1px var(--tpqrs-primary);
}

.titan-radio-card.selected .titan-radio-pill,
.titan-radio-card:has(.titan-radio-input:checked) .titan-radio-pill {
	border-color: var(--tpqrs-primary);
}

.titan-radio-card.selected .titan-radio-pill::after,
.titan-radio-card:has(.titan-radio-input:checked) .titan-radio-pill::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tpqrs-primary);
}

.titan-radio-content {
	display: flex;
	flex-direction: column;
	line-height: 1.4;
}

.titan-radio-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--tpqrs-dark);
}

.titan-radio-desc {
	font-size: 13px;
	color: var(--tpqrs-muted);
	margin-top: 2px;
}

/* Checkbox Items */
.titan-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.titan-checkbox-item,
.titan-consent-label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	line-height: 1.5;
}

.titan-checkbox-input,
.titan-consent-checkbox {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.titan-checkbox-box {
	width: 18px;
	height: 18px;
	border-radius: 4px;
	border: 2px solid #94a3b8;
	background: #ffffff;
	flex-shrink: 0;
	margin-top: 2px;
	position: relative;
	transition: all 0.2s ease;
}

.titan-checkbox-item:hover .titan-checkbox-box,
.titan-consent-label:hover .titan-checkbox-box {
	border-color: var(--tpqrs-primary);
}

.titan-checkbox-item:has(.titan-checkbox-input:checked) .titan-checkbox-box,
.titan-consent-label:has(.titan-consent-checkbox:checked) .titan-checkbox-box {
	background: var(--tpqrs-primary);
	border-color: var(--tpqrs-primary);
}

.titan-checkbox-item:has(.titan-checkbox-input:checked) .titan-checkbox-box::after,
.titan-consent-label:has(.titan-consent-checkbox:checked) .titan-checkbox-box::after {
	content: '';
	position: absolute;
	top: 1px;
	left: 5px;
	width: 4px;
	height: 9px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Legal Consent Box */
.titan-legal-consent-box {
	background: #f8fafc;
	border: 1px solid var(--tpqrs-border);
	padding: 16px 20px;
	border-radius: var(--tpqrs-radius);
}

.titan-consent-text {
	font-size: 13px;
	color: var(--tpqrs-slate);
}

/* File Upload Zone */
.titan-file-upload-zone {
	border: 2px dashed #cbd5e1;
	border-radius: var(--tpqrs-radius);
	padding: 25px 20px;
	text-align: center;
	background: #f8fafc;
	cursor: pointer;
	position: relative;
	transition: all 0.2s ease;
}

.titan-file-upload-zone:hover,
.titan-file-upload-zone.dragover {
	border-color: var(--tpqrs-primary);
	background: #f0f7ff;
}

.titan-file-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.titan-upload-icon {
	color: var(--tpqrs-primary);
	margin-bottom: 8px;
}

.titan-file-prompt-text {
	font-size: 14px;
	color: var(--tpqrs-slate);
	margin-bottom: 4px;
}

.titan-file-limits {
	font-size: 12px;
	color: var(--tpqrs-muted);
}

.titan-selected-files-list {
	margin-top: 15px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	text-align: left;
}

.titan-file-chip {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #ffffff;
	border: 1px solid var(--tpqrs-border);
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 13px;
	color: var(--tpqrs-slate);
}

.titan-file-chip-name {
	display: flex;
	align-items: center;
	gap: 6px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.titan-file-chip-remove {
	color: #ef4444;
	cursor: pointer;
	font-weight: 700;
	padding: 0 4px;
	margin-left: 8px;
}

/* Navigation Buttons */
.titan-nav-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 35px;
	padding-top: 25px;
	border-top: 1px solid var(--tpqrs-border);
}

.titan-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	border-radius: var(--tpqrs-radius);
	cursor: pointer;
	border: none;
	outline: none;
	transition: all 0.2s ease;
	text-decoration: none;
}

.titan-btn-prev {
	background: #f1f5f9;
	color: var(--tpqrs-slate);
}

.titan-btn-prev:hover {
	background: #e2e8f0;
	color: var(--tpqrs-dark);
}

.titan-btn-next,
.titan-btn-submit {
	background: var(--tpqrs-primary);
	color: var(--tpqrs-btn-text);
	margin-left: auto;
}

.titan-btn-next:hover,
.titan-btn-submit:hover {
	background: #00ADEF !important;
	color: #ffffff !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 173, 239, 0.35);
}

.titan-btn-secondary {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	color: var(--tpqrs-slate);
}

.titan-btn-secondary:hover {
	border-color: var(--tpqrs-primary);
	color: var(--tpqrs-primary);
}

.titan-btn-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: titanSpin 0.7s linear infinite;
}

@keyframes titanSpin {
	to { transform: rotate(360deg); }
}

/* Global Alert */
.titan-global-alert {
	margin-top: 20px;
	padding: 12px 16px;
	border-radius: var(--tpqrs-radius);
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	font-size: 14px;
	font-weight: 500;
	animation: titanFadeIn 0.3s ease;
}

/* Success Confirmation Screen */
.titan-success-screen {
	text-align: center;
	padding: 20px 0;
	animation: titanFadeIn 0.4s ease;
}

.titan-success-icon-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 20px;
}

.titan-success-circle {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: var(--tpqrs-success);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 20px -3px rgba(5, 150, 105, 0.3);
}

.titan-success-title {
	font-size: 24px;
	font-weight: 700;
	color: var(--tpqrs-dark);
	margin: 0 0 10px 0;
}

.titan-success-message {
	font-size: 15px;
	color: var(--tpqrs-muted);
	margin: 0 auto 30px;
	max-width: 600px;
	line-height: 1.5;
}

.titan-radicado-card {
	background: #f0f7ff;
	border: 2px dashed #0089F7;
	border-radius: calc(var(--tpqrs-radius) + 4px);
	padding: 25px 20px;
	max-width: 480px;
	margin: 0 auto 30px;
}

.titan-radicado-card-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	color: var(--tpqrs-primary);
	text-transform: uppercase;
	display: block;
	margin-bottom: 8px;
}

.titan-radicado-number-box {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
}

.titan-radicado-val {
	font-size: 28px;
	font-weight: 800;
	color: var(--tpqrs-dark);
	letter-spacing: 1.5px;
}

.titan-copy-radicado-btn {
	background: #ffffff;
	border: 1px solid #bfdbfe;
	color: var(--tpqrs-primary);
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s ease;
}

.titan-copy-radicado-btn:hover {
	background: var(--tpqrs-primary);
	color: #ffffff;
	border-color: var(--tpqrs-primary);
}

.titan-radicado-hint {
	font-size: 12px;
	color: var(--tpqrs-muted);
	margin: 10px 0 0 0;
}

.titan-success-details {
	display: flex;
	justify-content: center;
	gap: 25px;
	margin-bottom: 25px;
	flex-wrap: wrap;
	font-size: 14px;
}

.titan-success-detail-item .detail-label {
	color: var(--tpqrs-muted);
	margin-right: 4px;
}

.titan-email-notice {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: #f8fafc;
	border: 1px solid var(--tpqrs-border);
	padding: 12px 20px;
	border-radius: var(--tpqrs-radius);
	font-size: 13px;
	color: var(--tpqrs-slate);
	max-width: 600px;
}

/* Responsive adjustments */
@media screen and (max-width: 680px) {
	.titan-pqrs-container {
		padding: 25px 20px;
	}

	.titan-field-wrapper.col-50 {
		flex: 0 0 100%;
		max-width: 100%;
	}

	.titan-dot-label {
		display: none;
	}

	.titan-radicado-val {
		font-size: 22px;
	}

	.titan-nav-footer {
		flex-direction: column-reverse;
		gap: 12px;
	}

	.titan-btn-prev,
	.titan-btn-next,
	.titan-btn-submit {
		width: 100%;
		margin-left: 0;
	}
}
