/*
 * Formulario del cliente (index.php) y pantallas publicas (error.php).
 * Hecho primero para el celular: casi todos lo abren desde el correo en el
 * telefono. Colores de la marca Addiuva.
 */
:root {
	--marino: #092F6D;
	--azul: #5566FF;
	--azul-suave: #EEF0FF;
	--verde: #05A177;
	--verde-suave: #E6F7F1;
	--rojo: #C62D3C;
	--rojo-suave: #FDECEE;
	--texto: #1D2433;
	--texto-suave: #5B6475;
	--borde: #D8DEE8;
	--fondo: #F3F5F9;
	--blanco: #FFFFFF;
	--radio: 12px;
	--sombra: 0 1px 2px rgba(9, 47, 109, .06), 0 4px 16px rgba(9, 47, 109, .06);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: var(--texto);
	background: var(--fondo);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ---------- Cabecera ---------- */
.cabecera {
	background: var(--marino);
	color: var(--blanco);
	padding: 14px 16px;
}
.cabecera__interior {
	max-width: 760px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.cabecera img { height: 28px; width: auto; display: block; }
.cabecera .imed {
	background: var(--blanco);
	border-radius: 8px;
	padding: 4px 8px;
	height: 32px;
}

.contenedor {
	width: 100%;
	max-width: 760px;
	margin: 0 auto;
	padding: 24px 16px 40px;
	flex: 1;
}

/* ---------- Presentacion ---------- */
.intro h1 {
	font-size: 1.6rem;
	line-height: 1.25;
	color: var(--marino);
	margin-bottom: 8px;
}
.intro p { color: var(--texto-suave); }
.intro .saludo { color: var(--texto); font-weight: 500; margin-bottom: 4px; }
.lista-necesitas {
	margin: 16px 0 24px;
	padding: 14px 16px;
	background: var(--azul-suave);
	border-radius: var(--radio);
	list-style: none;
	display: grid;
	gap: 6px;
	font-size: .95rem;
}
.lista-necesitas li::before { content: "✓"; color: var(--azul); font-weight: 700; margin-right: 8px; }

.aviso {
	padding: 12px 14px;
	border-radius: 10px;
	margin-bottom: 16px;
	font-size: .95rem;
	border-left: 4px solid var(--azul);
	background: var(--azul-suave);
}
.aviso--devuelto { border-left-color: #D98E04; background: #FFF6E0; }

/* ---------- Tarjetas por paso ---------- */
.tarjeta {
	background: var(--blanco);
	border-radius: var(--radio);
	box-shadow: var(--sombra);
	padding: 20px 16px;
	margin-bottom: 16px;
}
.tarjeta h2 {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.1rem;
	color: var(--marino);
	margin-bottom: 4px;
}
.tarjeta .ayuda-titulo { color: var(--texto-suave); font-size: .9rem; margin: 0 0 16px 38px; }
.num {
	flex: none;
	width: 28px; height: 28px;
	border-radius: 50%;
	background: var(--marino);
	color: var(--blanco);
	font-size: .9rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.grilla { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 600px) {
	.grilla { grid-template-columns: 1fr 1fr; }
	.grilla .ancho { grid-column: 1 / -1; }
	.tarjeta { padding: 24px; }
}

/* ---------- Campos ---------- */
.campo label, .campo .etiqueta {
	display: block;
	font-size: .88rem;
	font-weight: 500;
	margin-bottom: 6px;
}
.campo .opcional { color: var(--texto-suave); font-weight: 400; }
.campo input[type=text], .campo input[type=email], .campo input[type=tel],
.campo select, .campo textarea {
	width: 100%;
	font: inherit;
	color: var(--texto);
	background: var(--blanco);
	border: 1px solid var(--borde);
	border-radius: 10px;
	padding: 12px 12px;
	min-height: 48px;
	transition: border-color .15s, box-shadow .15s;
	appearance: none;
	-webkit-appearance: none;
}
.campo select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235B6475' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}
.campo textarea { min-height: 120px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
	outline: none;
	border-color: var(--azul);
	box-shadow: 0 0 0 3px rgba(85, 102, 255, .2);
}
.campo input[readonly] { background: var(--fondo); color: var(--texto-suave); }
.campo .nota { display: block; font-size: .8rem; color: var(--texto-suave); margin-top: 4px; }
.campo.con-error input, .campo.con-error select, .campo.con-error textarea,
.campo.con-error .archivo { border-color: var(--rojo); }
.campo .error-campo { display: none; font-size: .82rem; color: var(--rojo); margin-top: 4px; }
.campo.con-error .error-campo { display: block; }

.monto { position: relative; }
.monto::before {
	content: "$";
	position: absolute;
	left: 13px; top: 50%;
	transform: translateY(-50%);
	color: var(--texto-suave);
}
.monto input { padding-left: 28px !important; }

/* ---------- Archivos ---------- */
.archivo {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 1px dashed var(--borde);
	border-radius: 10px;
	padding: 10px 12px;
	min-height: 48px;
	background: var(--blanco);
	cursor: pointer;
	position: relative;
}
.archivo:focus-within { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(85, 102, 255, .2); }
.archivo input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.archivo .boton-archivo {
	flex: none;
	font-size: .85rem;
	font-weight: 500;
	color: var(--azul);
	background: var(--azul-suave);
	border-radius: 8px;
	padding: 6px 10px;
}
.archivo .nombre-archivo {
	font-size: .9rem;
	color: var(--texto-suave);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}
.archivo.elegido { border-style: solid; border-color: var(--verde); background: var(--verde-suave); }
.archivo.elegido .nombre-archivo { color: var(--texto); }

.documento {
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr;
	padding: 12px;
	border: 1px solid var(--borde);
	border-radius: 10px;
	margin-bottom: 10px;
}
@media (min-width: 600px) { .documento { grid-template-columns: 160px 1fr 150px auto; align-items: end; } }
.quitar {
	font: inherit;
	font-size: .88rem;
	color: var(--rojo);
	background: none;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 10px 12px;
	cursor: pointer;
	min-height: 44px;
}
.quitar:hover { background: var(--rojo-suave); }

.ya-enviados {
	font-size: .9rem;
	background: var(--fondo);
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 12px;
}
.ya-enviados ul { list-style: none; margin-top: 6px; display: grid; gap: 4px; }
.ya-enviados a, .enlace { color: var(--azul); font-weight: 500; text-decoration: none; }
.ya-enviados a:hover, .enlace:hover { text-decoration: underline; }
.ya-enviado { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.ya-enviado__quitar { margin-left: auto; font-size: .85rem; color: var(--texto-suave, #5B6475); cursor: pointer; }
.ya-enviado.quitado > a { text-decoration: line-through; opacity: .6; }

/* ---------- Botones ---------- */
.boton {
	font: inherit;
	font-weight: 500;
	border: none;
	border-radius: 10px;
	padding: 12px 18px;
	min-height: 48px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.boton--secundario { background: var(--azul-suave); color: var(--azul); }
.boton--secundario:hover { background: #E1E5FF; }
.boton--principal { background: var(--marino); color: var(--blanco); width: 100%; font-size: 1.05rem; }
.boton--principal:hover { background: #0C3C8A; }
.boton[disabled] { opacity: .6; cursor: wait; }
.boton:focus-visible, .quitar:focus-visible { outline: 3px solid rgba(85, 102, 255, .45); outline-offset: 2px; }

/* ---------- Firma ---------- */
.firma {
	position: relative;
	border: 1px solid var(--borde);
	border-radius: 10px;
	background: var(--blanco);
	height: 220px;
	touch-action: none;
	overflow: hidden;
}
.firma canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.firma .linea {
	position: absolute;
	left: 16px; right: 16px; bottom: 44px;
	border-bottom: 1px solid var(--borde);
	pointer-events: none;
}
.firma .indicacion {
	position: absolute;
	left: 16px; bottom: 16px;
	font-size: .8rem;
	color: var(--texto-suave);
	pointer-events: none;
}
.firma-acciones { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---------- Confirmacion ---------- */
.texto-legal {
	font-size: .9rem;
	color: var(--texto-suave);
	background: var(--fondo);
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 14px;
	max-height: 220px;
	overflow: auto;
}
.casilla {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	font-size: .92rem;
	margin-bottom: 12px;
	cursor: pointer;
}
.casilla input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--marino); }
.casilla.con-error { color: var(--rojo); }

.resumen-errores {
	display: none;
	background: var(--rojo-suave);
	color: var(--rojo);
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 14px;
	font-size: .92rem;
}
.resumen-errores.visible { display: block; }
.resumen-errores ul { margin: 6px 0 0 18px; }

/* ---------- Estado final ---------- */
.estado {
	background: var(--blanco);
	border-radius: var(--radio);
	box-shadow: var(--sombra);
	padding: 32px 20px;
	text-align: center;
}
.estado .icono {
	width: 64px; height: 64px;
	border-radius: 50%;
	margin: 0 auto 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	background: var(--verde-suave);
	color: var(--verde);
}
.estado--aviso .icono { background: var(--azul-suave); color: var(--azul); }
.estado h1, .estado h2 { color: var(--marino); font-size: 1.35rem; margin-bottom: 8px; }
.estado p { color: var(--texto-suave); margin-bottom: 8px; }

/* Cargando */
.cargando {
	position: fixed;
	inset: 0;
	background: rgba(243, 245, 249, .85);
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 14px;
	z-index: 10;
	color: var(--marino);
	font-weight: 500;
	text-align: center;
	padding: 16px;
}
.cargando.visible { display: flex; }
.cargando .rueda {
	width: 44px; height: 44px;
	border: 4px solid var(--azul-suave);
	border-top-color: var(--azul);
	border-radius: 50%;
	animation: girar 0.9s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.pie {
	text-align: center;
	font-size: .82rem;
	color: var(--texto-suave);
	padding: 20px 16px 28px;
}
.pie a { color: inherit; }

.oculto { display: none !important; }

/* Con un solo documento no se ofrece quitarlo */
#documentos .documento:only-child .quitar { display: none; }
@media (min-width: 600px) { #documentos .documento:only-child { grid-template-columns: 160px 1fr 150px; } }

/* Total reclamado: suma de los montos de los documentos */
.total-reclamado {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-top: 14px;
	padding: 12px 14px;
	border-radius: 10px;
	background: var(--azul-suave);
	color: var(--azul);
	font-weight: 500;
}
.total-reclamado strong { font-size: 1.25rem; }

#nota-total { display: block; margin-top: 6px; font-size: .85rem; color: var(--texto-suave); }

.nota-aviso { font-size: .85rem; color: var(--texto-suave); }
