/* ==========================================================================
   Rumifay – Modal de cuenta (login / registro)
   ========================================================================== */

.rf-account-modal {
	--rf-acc-blue: #0057ff;
	--rf-acc-bg: #f5f9ff;
	--rf-acc-text: #0b1b3a;
	--rf-acc-muted: #6b7280;
	--rf-acc-border: #e5eeff;
	--rf-acc-radius: 20px;
	position: fixed;
	inset: 0;
	z-index: 100080;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 0;
	pointer-events: none;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.rf-account-modal.is-open {
	pointer-events: auto;
	visibility: visible;
	opacity: 1;
}

.rf-account-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(11, 27, 58, 0.72);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	opacity: 0;
	transition: opacity 0.28s ease;
}

.rf-account-modal.is-open .rf-account-modal__overlay {
	opacity: 1;
}

.rf-account-modal__dialog {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 440px;
	max-height: 92vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border: 1px solid var(--rf-acc-border);
	border-radius: 20px 20px 0 0;
	box-shadow: 0 -12px 48px rgba(11, 27, 58, 0.22);
	padding: 28px 22px 32px;
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.rf-account-modal.is-open .rf-account-modal__dialog {
	transform: translateY(0);
}

.rf-account-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--rf-acc-bg);
	color: var(--rf-acc-muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease, background 0.2s ease;
	z-index: 3;
}

.rf-account-modal__close svg {
	width: 20px;
	height: 20px;
}

.rf-account-modal__close:hover {
	color: var(--rf-acc-text);
	background: var(--rf-acc-border);
}

.rf-account-modal__title {
	margin: 0 0 8px;
	font-size: 1.3125rem;
	font-weight: 800;
	color: var(--rf-acc-text);
	line-height: 1.25;
	letter-spacing: -0.02em;
	padding-right: 44px;
}

.rf-account-modal__subtitle {
	margin: 0 0 18px;
	font-size: 0.875rem;
	color: var(--rf-acc-muted);
	line-height: 1.5;
}

/* Bono registro */
.rf-account-bonus {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 18px;
	padding: 12px 14px;
	background: linear-gradient(135deg, #f5f9ff 0%, #eef4ff 100%);
	border: 1px solid var(--rf-acc-border);
	border-radius: 12px;
}

.rf-account-bonus__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	background: rgba(0, 87, 255, 0.1);
	color: var(--rf-acc-blue);
}

.rf-account-bonus__icon svg {
	width: 18px;
	height: 18px;
}

.rf-account-bonus__text {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--rf-acc-text);
	line-height: 1.4;
}

.rf-account-modal__panel {
	display: none;
}

.rf-account-modal__panel.is-active {
	display: block;
}

.rf-account-modal__notice {
	margin-bottom: 14px;
	padding: 12px 14px;
	border-radius: 12px;
	font-size: 0.8125rem;
	line-height: 1.45;
}

.rf-account-modal__notice.is-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.rf-account-modal__notice.is-success {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	color: #047857;
}

.rf-account-modal__footer-text {
	margin: 20px 0 0;
	text-align: center;
	font-size: 0.875rem;
	color: var(--rf-acc-muted);
}

/* Campos */
.rf-account-field {
	margin-bottom: 14px;
}

.rf-account-field__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--rf-acc-text);
}

.rf-account-field__input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--rf-acc-border);
	border-radius: 12px;
	font-size: 0.9375rem;
	color: var(--rf-acc-text);
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.rf-account-field__input:focus {
	outline: none;
	border-color: var(--rf-acc-blue);
	box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.12);
}

.rf-account-field__input.is-invalid,
.rf-account-checkbox.is-invalid {
	border-color: #f87171;
}

.rf-account-field__input.is-invalid:focus {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.rf-account-checkbox.is-invalid {
	outline: 2px solid rgba(220, 38, 38, 0.35);
	outline-offset: 2px;
	border-radius: 8px;
}

.rf-account-field__hint {
	margin: 4px 0 0;
	font-size: 0.75rem;
	color: var(--rf-acc-muted);
	line-height: 1.4;
}

.rf-account-field__error {
	margin: 6px 0 0;
	font-size: 0.75rem;
	font-weight: 600;
	color: #dc2626;
	line-height: 1.35;
}

.rf-account-field__error--checkbox {
	margin-top: -10px;
	margin-bottom: 12px;
	padding-left: 26px;
}

.rf-account-form__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.rf-account-form__row .rf-account-field {
	margin-bottom: 0;
}

.rf-account-form--register {
	margin-top: 4px;
}

.rf-account-form--register .rf-account-field {
	margin-bottom: 12px;
}

.rf-account-field__password {
	position: relative;
}

.rf-account-field__password .rf-account-field__input {
	padding-right: 46px;
}

.rf-account-field__toggle {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	width: 34px;
	height: 34px;
	border: 0;
	background: transparent;
	color: var(--rf-acc-muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.rf-account-field__toggle:hover {
	color: var(--rf-acc-blue);
}

.rf-account-field__toggle svg {
	width: 20px;
	height: 20px;
}

.rf-account-form__links {
	margin: 0 0 16px;
	text-align: right;
}

.rf-account-link {
	border: 0;
	background: none;
	padding: 0;
	font-size: 0.8125rem;
	color: var(--rf-acc-blue);
	cursor: pointer;
	text-decoration: none;
	font-family: inherit;
}

.rf-account-link:hover {
	text-decoration: underline;
}

.rf-account-link--bold {
	font-weight: 700;
}

.rf-account-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 14px 20px;
	border: 0;
	border-radius: 12px;
	font-size: 0.9375rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}

.rf-account-btn--primary {
	background: var(--rf-acc-blue);
	color: #fff;
	box-shadow: 0 4px 14px rgba(0, 87, 255, 0.28);
}

.rf-account-btn--primary:hover {
	background: #0046d9;
}

.rf-account-btn--primary:active {
	transform: scale(0.98);
}

.rf-account-btn.is-loading {
	opacity: 0.75;
	pointer-events: none;
}

.rf-account-checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 16px;
	font-size: 0.8125rem;
	color: var(--rf-acc-muted);
	line-height: 1.4;
	cursor: pointer;
}

.rf-account-checkbox input {
	margin-top: 3px;
	accent-color: var(--rf-acc-blue);
}

.rf-account-checkbox a {
	color: var(--rf-acc-blue);
}

/* Header: avatar sesión iniciada */
button.rf-action--account {
	border: 0;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
	text-align: left;
}

.rf-account-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--rf-acc-blue, #0057ff);
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 800;
	line-height: 1;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 87, 255, 0.25);
	overflow: hidden;
}

.rf-account-avatar.rf-account-avatar--img {
	display: block;
	background: transparent;
	box-shadow: 0 2px 8px rgba(11, 27, 58, 0.12);
	border: 2px solid #fff;
}

.rf-action--icon-only .rf-account-avatar {
	width: 32px;
	height: 32px;
	font-size: 0.8125rem;
}

.rf-action--account.is-logged-in .rf-action__icon {
	display: none;
}

.rf-action--account.is-logged-in .rf-action__label {
	display: none;
}

body.rf-account-modal-open {
	overflow: hidden;
}

.rf-drawer__footer {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rf-drawer__account-link {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	color: var(--rf-primary);
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.rf-drawer__account-link:hover {
	text-decoration: underline;
}

.rf-drawer__footer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-start;
}

.rf-drawer__account-link--register {
	color: #0057ff;
}

.rf-account-slot {
	display: contents;
}

/* Menú cuenta (usuario logueado) */
.rf-account-menu {
	position: fixed;
	z-index: 100050;
	min-width: 220px;
	padding: 8px;
	background: #fff;
	border: 1px solid #e5eeff;
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(11, 27, 58, 0.16);
	box-sizing: border-box;
}

.rf-account-menu[hidden] {
	display: none !important;
}

.rf-account-menu.is-open {
	display: block;
	animation: rf-account-menu-in 0.2s ease;
}

@keyframes rf-account-menu-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.rf-account-menu--guest .rf-account-menu__item {
	width: 100%;
	border: 0;
	background: transparent;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.rf-account-menu__item--register {
	color: #0057ff;
	font-weight: 600;
}

.rf-account-menu__item {
	display: block;
	padding: 12px 14px;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #0b1b3a;
	text-decoration: none;
	border-radius: 10px;
	transition: background 0.15s ease, color 0.15s ease;
}

.rf-account-menu__item:hover,
.rf-account-menu__item:focus {
	background: #f5f9ff;
	color: #0057ff;
}

.rf-account-menu__item--logout {
	color: #dc2626;
	margin-top: 4px;
	border-top: 1px solid #e5eeff;
	border-radius: 0 0 10px 10px;
	padding-top: 14px;
}

.rf-account-menu__item--logout:hover {
	background: #fef2f2;
	color: #b91c1c;
}

.rf-action--account.is-logged-in {
	cursor: pointer;
	border: 0;
	background: transparent;
	font: inherit;
	text-align: inherit;
}

button.rf-action--account {
	pointer-events: auto;
}

/* PC – modal centrado */
@media (min-width: 769px) {
	.rf-account-modal {
		align-items: center;
		padding: 24px;
	}

	.rf-account-modal__dialog {
		border-radius: 20px;
		max-height: 88vh;
		padding: 32px 28px 36px;
		transform: translateY(16px) scale(0.96);
		opacity: 0;
		transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
		box-shadow: 0 24px 64px rgba(11, 27, 58, 0.2);
	}

	.rf-account-modal__dialog--register {
		max-width: 520px;
	}

	.rf-account-modal.is-open .rf-account-modal__dialog {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

@media (max-width: 480px) {
	.rf-account-form__row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.rf-account-form__row .rf-account-field {
		margin-bottom: 12px;
	}
}
