/* ====================================================================
 * Edit Account — CICP rediseño
 * ==================================================================== */

:root {
	--rcicp-bg: #f7f8fb;
	--rcicp-card-bg: #ffffff;
	--rcicp-border: rgba(226, 232, 240, 0.7);
	--rcicp-border-hover: rgba(190, 200, 215, 0.9);
	--rcicp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
	--rcicp-shadow-hover: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.08);
	--rcicp-text: #0f172a;
	--rcicp-text-muted: #64748b;
	--rcicp-text-soft: #94a3b8;
	--rcicp-primary: #B81F1F;
	--rcicp-primary-hover: #9a1818;
	--rcicp-primary-soft: rgba(184, 31, 31, 0.08);
	--rcicp-primary-tint: rgba(184, 31, 31, 0.04);
	--rcicp-success: #16a34a;
	--rcicp-warning: #f59e0b;
	--rcicp-danger: #dc2626;
	--rcicp-input-bg: #ffffff;
	--rcicp-input-border: #d6deea;
	--rcicp-input-border-focus: var(--rcicp-primary);
	--rcicp-input-shadow-focus: 0 0 0 4px rgba(184, 31, 31, 0.12);
	--rcicp-radius: 14px;
	--rcicp-radius-sm: 10px;
	--rcicp-radius-input: 10px;
}

/* Reset del wrapper WC heredado para evitar dobles bordes */
.woocommerce-MyAccount-content .woocommerce-form,
.woocommerce-MyAccount-content .woocommerce-EditAccountForm.rcicp-edit-account {
	max-width: 100%;
}

.rcicp-edit-account {
	display: flex;
	flex-direction: column;
	gap: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
	color: var(--rcicp-text);
}

/* ── Header de página ────────────────────────────────────────────── */
.rcicp-page-header {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 4px 4px 16px;
	border-bottom: 1px solid var(--rcicp-border);
	margin-bottom: 4px;
}
.rcicp-page-header__icon {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--rcicp-primary) 0%, #d63838 100%);
	color: #fff;
	display: grid;
	place-items: center;
	flex-shrink: 0;
	box-shadow: 0 6px 14px rgba(184, 31, 31, 0.22);
}
.rcicp-page-header__title {
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	margin: 0 0 4px 0;
	color: var(--rcicp-text);
	letter-spacing: -0.01em;
}
.rcicp-page-header__desc {
	font-size: 14px;
	line-height: 1.55;
	color: var(--rcicp-text-muted);
	margin: 0;
	max-width: 640px;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.rcicp-card {
	background: var(--rcicp-card-bg);
	border: 1px solid var(--rcicp-border);
	border-radius: var(--rcicp-radius);
	padding: 24px;
	box-shadow: var(--rcicp-shadow);
	transition: border-color .18s ease, box-shadow .18s ease;
}
.rcicp-card:hover {
	border-color: var(--rcicp-border-hover);
}
.rcicp-card__head {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 22px;
	padding-bottom: 18px;
	border-bottom: 1px dashed var(--rcicp-border);
}
.rcicp-card__icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--rcicp-primary-soft);
	color: var(--rcicp-primary);
	display: grid;
	place-items: center;
	flex-shrink: 0;
}
.rcicp-card__title {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 4px 0;
	color: var(--rcicp-text);
	letter-spacing: -0.005em;
}
.rcicp-card__desc {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--rcicp-text-muted);
	margin: 0;
}
.rcicp-card--security {
	background: linear-gradient(135deg, #ffffff 0%, var(--rcicp-primary-tint) 100%);
}
.rcicp-card--security .rcicp-card__icon {
	background: var(--rcicp-primary);
	color: #ffffff;
}

/* ── Grid ─────────────────────────────────────────────────────────── */
.rcicp-grid {
	display: grid;
	gap: 18px 22px;
}
.rcicp-grid--1col { grid-template-columns: 1fr; }
.rcicp-grid--2col { grid-template-columns: repeat(2, 1fr); }
.rcicp-grid + .rcicp-grid { margin-top: 18px; }

/* ── Field ────────────────────────────────────────────────────────── */
.rcicp-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
}
.rcicp-field label {
	font-size: 13px;
	font-weight: 600;
	color: var(--rcicp-text);
	letter-spacing: 0.005em;
	display: flex;
	align-items: center;
	gap: 6px;
}
.rcicp-required {
	color: var(--rcicp-primary);
	font-weight: 700;
}
.rcicp-hint-inline {
	font-weight: 400;
	color: var(--rcicp-text-soft);
	font-size: 12px;
}
.rcicp-field input.input-text,
.rcicp-field input[type="text"],
.rcicp-field input[type="email"],
.rcicp-field input[type="password"],
.rcicp-field input[type="tel"] {
	width: 100%;
	height: 44px;
	padding: 0 14px;
	font-size: 14.5px;
	color: var(--rcicp-text);
	background: var(--rcicp-input-bg);
	border: 1.5px solid var(--rcicp-input-border);
	border-radius: var(--rcicp-radius-input);
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
	box-sizing: border-box;
	font-family: inherit;
}
.rcicp-field input:hover {
	border-color: var(--rcicp-border-hover);
}
.rcicp-field input:focus {
	border-color: var(--rcicp-input-border-focus);
	box-shadow: var(--rcicp-input-shadow-focus);
}
.rcicp-field input::placeholder {
	color: var(--rcicp-text-soft);
}
.rcicp-hint {
	font-size: 12px;
	color: var(--rcicp-text-soft);
	line-height: 1.45;
	margin-top: 2px;
}

/* ── Password fields ──────────────────────────────────────────────── */
.rcicp-input-wrap {
	position: relative;
	display: block;
}
.rcicp-input-wrap input {
	padding-right: 44px !important;
}
.rcicp-toggle-pass {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--rcicp-text-soft);
	cursor: pointer;
	border-radius: 8px;
	display: grid;
	place-items: center;
	transition: background .15s ease, color .15s ease;
	padding: 0;
}
.rcicp-toggle-pass:hover {
	background: var(--rcicp-primary-soft);
	color: var(--rcicp-primary);
}
.rcicp-pass-strength {
	display: flex;
	gap: 4px;
	margin-top: 4px;
	height: 4px;
}
.rcicp-pass-strength::before,
.rcicp-pass-strength::after,
.rcicp-pass-strength span {
	content: '';
	flex: 1;
	height: 4px;
	background: #e5e7eb;
	border-radius: 2px;
	transition: background .2s ease;
}
.rcicp-pass-strength[data-strength="weak"]::before { background: var(--rcicp-danger); }
.rcicp-pass-strength[data-strength="medium"]::before,
.rcicp-pass-strength[data-strength="medium"]::after { background: var(--rcicp-warning); }
.rcicp-pass-strength[data-strength="strong"]::before,
.rcicp-pass-strength[data-strength="strong"]::after,
.rcicp-pass-strength[data-strength="strong"] span { background: var(--rcicp-success); }
.rcicp-pass-match {
	font-size: 12px;
	font-weight: 500;
	min-height: 16px;
	margin-top: 2px;
	transition: color .15s ease;
}
.rcicp-pass-match.match {
	color: var(--rcicp-success);
}
.rcicp-pass-match.no-match {
	color: var(--rcicp-danger);
}

/* ── File field ───────────────────────────────────────────────────── */
.rcicp-file-field {
	gap: 8px;
}
.rcicp-file-current {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: rgba(22, 163, 74, 0.08);
	border: 1px solid rgba(22, 163, 74, 0.2);
	border-radius: var(--rcicp-radius-sm);
	color: var(--rcicp-success);
	font-size: 13px;
	font-weight: 500;
}
.rcicp-file-current a {
	color: var(--rcicp-success);
	text-decoration: underline;
	text-underline-offset: 2px;
	font-weight: 500;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.rcicp-file-input {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	background: #f8fafc;
	border: 1.5px dashed var(--rcicp-input-border);
	border-radius: var(--rcicp-radius-input);
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}
.rcicp-file-input:hover {
	border-color: var(--rcicp-primary);
	background: var(--rcicp-primary-soft);
}
.rcicp-file-input input[type="file"] {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}
.rcicp-file-input__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: var(--rcicp-primary);
	color: #fff;
	border-radius: 8px;
	font-size: 12.5px;
	font-weight: 600;
	white-space: nowrap;
}
.rcicp-file-input__name {
	font-size: 13px;
	color: var(--rcicp-text-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
	flex: 1;
}

/* ── Botón guardar ────────────────────────────────────────────────── */
.rcicp-actions {
	display: flex;
	justify-content: flex-end;
	padding: 8px 4px 4px;
	position: sticky;
	bottom: 16px;
	z-index: 5;
}
.rcicp-save-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: linear-gradient(135deg, var(--rcicp-primary) 0%, #d63838 100%);
	color: #fff;
	border: none;
	border-radius: var(--rcicp-radius-input);
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(184, 31, 31, 0.32), 0 2px 4px rgba(184, 31, 31, 0.2);
	transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
	letter-spacing: 0.01em;
}
.rcicp-save-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(184, 31, 31, 0.36), 0 3px 6px rgba(184, 31, 31, 0.22);
	background: linear-gradient(135deg, var(--rcicp-primary-hover) 0%, #b32d2d 100%);
}
.rcicp-save-btn:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(184, 31, 31, 0.28);
}
.rcicp-save-btn[disabled] {
	opacity: .55;
	cursor: not-allowed;
	transform: none;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
	.rcicp-grid--2col { grid-template-columns: 1fr; }
	.rcicp-card { padding: 18px; border-radius: 12px; }
	.rcicp-card__head { gap: 12px; margin-bottom: 18px; padding-bottom: 14px; }
	.rcicp-page-header { padding-top: 0; gap: 12px; }
	.rcicp-page-header__icon { width: 44px; height: 44px; }
	.rcicp-page-header__title { font-size: 20px; }
	.rcicp-page-header__desc { font-size: 13px; }
	.rcicp-actions { position: static; padding: 4px; }
	.rcicp-save-btn { width: 100%; justify-content: center; }
}

/* ── Reset estilos WC heredados que rompen el layout ───────────────── */
.rcicp-edit-account fieldset { border: none; padding: 0; margin: 0; }
.rcicp-edit-account legend { display: none; }
.rcicp-edit-account p { margin: 0; }
.rcicp-edit-account .form-row,
.rcicp-edit-account .woocommerce-form-row { padding: 0; margin: 0; }

/* Si BB theme inyecta sub-headings legacy, ocultarlos */
.rcicp-edit-account .wc-MyAccount-sub-heading,
.rcicp-edit-account .wc-MyAccount-inner-content,
.rcicp-edit-account .woocommerce-account-fields { display: contents; }
