/* eSIM Top-Up portal */
.esim-topup {
	--esim-topup-brand: #13a89e;
	--esim-topup-brand-hover: #0f948b;
	--esim-topup-brand-soft: #eef8f6;
	--esim-topup-text: #1a2b2a;
	--esim-topup-muted: #6b7c7a;
	--esim-topup-border: rgba(19, 168, 158, 0.14);

	max-width: 1080px;
	margin: 0 auto;
	padding: 40px 24px 72px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--esim-topup-text);
	box-sizing: border-box;
}

.esim-topup--dashboard {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 28px 24px 80px;
	background: linear-gradient(180deg, #ffffff 0%, #f8fcfb 28%, #f3faf8 100%);
	border-radius: 0;
}

.esim-topup__breadcrumbs {
	max-width: 760px;
	margin: 0 auto 36px;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: #9aa8a6;
	display: none;
}

.esim-topup__breadcrumbs a {
	color: #9aa8a6;
	text-decoration: none;
}

.esim-topup__breadcrumbs a:hover {
	color: #6b7c7a;
}

.esim-topup__breadcrumb-sep {
	margin: 0 0.4em;
	color: #c5d0ce;
}

.esim-topup__breadcrumb-current {
	color: #8a9896;
}

.esim-topup__dashboard-inner {
	max-width: 760px;
	margin: 0 auto;
}

.esim-topup--dashboard .esim-topup__title {
	font-size: clamp(1.75rem, 4vw, 2.125rem);
	letter-spacing: -0.02em;
}

.esim-topup--dashboard .esim-topup__subtitle {
	color: var(--esim-topup-muted);
	margin-bottom: 0;
}

.esim-topup *,
.esim-topup *::before,
.esim-topup *::after {
	box-sizing: border-box;
}

.esim-topup__card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 32px;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.esim-topup__title {
	margin: 0 0 8px;
	font-size: 1.75rem;
	font-weight: 700;
	color: #111827;
}

.esim-topup__subtitle {
	margin: 0 0 24px;
	color: #6b7280;
	font-size: 0.95rem;
}

.esim-topup__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 28px;
}

.esim-topup__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	color: #374151;
}

.esim-topup__input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	font-size: 1rem;
	margin-bottom: 16px;
}

.esim-topup__input:focus {
	outline: none;
	border-color: var(--esim-topup-brand);
	box-shadow: 0 0 0 3px rgba(19, 168, 158, 0.15);
}

.esim-topup__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 18px;
	border-radius: 10px;
	font-size: 0.875rem;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.esim-topup__btn--primary,
.esim-topup__btn--buy {
	background: var(--esim-topup-brand);
	color: #fff;
	box-shadow: 0 4px 14px rgba(19, 168, 158, 0.22);
}

.esim-topup__btn--primary:hover,
.esim-topup__btn--buy:hover {
	background: var(--esim-topup-brand-hover);
	color: #fff;
	box-shadow: 0 6px 18px rgba(19, 168, 158, 0.28);
}

.esim-topup__btn--primary:active,
.esim-topup__btn--buy:active {
	transform: translateY(1px);
}

.esim-topup__btn--logout {
	background: #f8f3e4;
	color: #c6a15a;
	border-color: transparent;
	border-radius: 999px;
	padding: 8px 18px;
	font-weight: 600;
	box-shadow: none;
}

.esim-topup__btn--logout:hover {
	background: #f3ead4;
	color: #b08a3e;
}

.esim-topup__btn--outline {
	background: #fff;
	color: var(--esim-topup-brand);
	border-color: rgba(19, 168, 158, 0.35);
}

.esim-topup__btn--outline:hover {
	background: var(--esim-topup-brand-soft);
	color: var(--esim-topup-brand-hover);
	border-color: var(--esim-topup-brand);
}

.esim-topup__btn--ghost {
	background: #fff;
	color: var(--esim-topup-text);
	border-color: #dce8e6;
}

.esim-topup__btn--ghost:hover {
	background: var(--esim-topup-brand-soft);
	color: var(--esim-topup-brand-hover);
	border-color: rgba(19, 168, 158, 0.35);
}

.esim-topup__btn--buy {
	width: 100%;
	margin-top: 12px;
}

.esim-topup__alert {
	padding: 12px 16px;
	border-radius: 10px;
	margin-bottom: 16px;
	font-size: 0.9rem;
}

.esim-topup__alert--error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.esim-topup__alert--success {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.esim-topup__notice {
	padding: 16px;
	border-radius: 10px;
	background: #f9fafb;
	color: #4b5563;
}

.esim-topup__notice--error {
	background: #fef2f2;
	color: #b91c1c;
}

.esim-topup__esim-grid,
.esim-topup__plans-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	max-width: 760px;
}

.esim-topup__esim-card,
.esim-topup__plan-card {
	border: 1px solid rgba(19, 168, 158, 0.12);
	border-radius: 18px;
	padding: 18px 20px;
	background: #f4faf9;
	box-shadow:
		0 1px 2px rgba(16, 42, 40, 0.04),
		0 10px 28px rgba(19, 168, 158, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.esim-topup__plan-card {
	background: #fff;
}

.esim-topup__esim-card--expired {
	opacity: 0.78;
	filter: grayscale(0.35);
	background: #f5f6f6;
}

.esim-topup__esim-card:hover,
.esim-topup__plan-card:hover {
	transform: translateY(-1px);
	box-shadow:
		0 2px 4px rgba(16, 42, 40, 0.06),
		0 14px 32px rgba(19, 168, 158, 0.12);
}

.esim-topup__esim-summary-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

.esim-topup__esim-identity {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	min-width: 0;
}

.esim-topup__esim-code {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.2;
	color: #111827;
	letter-spacing: 0.02em;
	padding-top: 2px;
}

.esim-topup__esim-flag {
	display: block;
	width: 28px;
	height: 21px;
	object-fit: cover;
	border-radius: 3px;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.esim-topup__esim-identity-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	min-width: 0;
}

.esim-topup__esim-name,
.esim-topup__plan-name {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
	color: #111827;
}

.esim-topup__esim-status {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.2;
	color: #fff;
}

.esim-topup__esim-status.is-active {
	background: #13a89e;
}

.esim-topup__esim-status.is-expired {
	background: #9ca3af;
}

.esim-topup__view-details {
	appearance: none;
	border: 0;
	background: transparent;
	color: #13a89e;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 4px 0;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
}

.esim-topup__view-details:hover {
	color: #0f766e;
	text-decoration: underline;
}

.esim-topup__supported-countries {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
	flex-wrap: wrap;
	padding: 12px 14px;
	border-radius: 12px;
	background: #fff8e8;
	border: 1px solid #f3e7c8;
}

.esim-topup__supported-countries-label {
	font-size: 0.6875rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #9a6b2f;
	white-space: nowrap;
}

.esim-topup__supported-countries-codes {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	min-width: 0;
}

.esim-topup__supported-code {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875rem;
	font-weight: 700;
	color: #7a5424;
	letter-spacing: 0.02em;
}

.esim-topup__supported-flag {
	display: block;
	width: 16px;
	height: 12px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(122, 84, 36, 0.15);
}

.esim-topup__country-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 22px;
	padding: 0 8px;
	border-radius: 999px;
	background: #e8d7b5;
	color: #7a5424;
	font-size: 0.75rem;
	font-weight: 700;
}

.esim-topup__esim-details {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid rgba(19, 168, 158, 0.12);
}

.esim-topup__esim-details[hidden] {
	display: none !important;
}

.esim-topup__esim-data,
.esim-topup__plan-data {
	margin: 0;
	padding: 4px 10px;
	border-radius: 999px;
	background: var(--esim-topup-brand-soft);
	color: var(--esim-topup-brand);
	font-weight: 700;
	font-size: 0.75rem;
	white-space: nowrap;
	flex-shrink: 0;
}

.esim-topup__plan-validity {
	margin: 4px 0 0;
	font-size: 0.85rem;
	color: #6b7280;
}

.esim-topup__countries {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
}

.esim-topup__country-code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 36px;
	height: 28px;
	padding: 0 10px;
	background: #e7f7f4;
	border: none;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--esim-topup-brand);
}

.esim-topup__country-flag {
	display: block;
	width: 16px;
	height: 12px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.esim-topup__order-id {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 0 0 14px;
	padding: 12px 14px;
	border-radius: 12px;
	background: #fff;
	border: 1px solid #e8efed;
	font-size: 0.875rem;
	color: #6b7280;
	line-height: 1.4;
	word-break: break-all;
}

.esim-topup__order-label {
	font-weight: 700;
	color: #374151;
}

.esim-topup__order-id code {
	padding: 0;
	background: none;
	color: var(--esim-topup-brand);
	font-size: 0.8125rem;
	font-weight: 700;
}

/* Tabs */
.esim-topup__esim-tabs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
	padding: 6px;
	margin: 0 0 14px;
	border-radius: 14px;
	background: #eaf4f2;
}

.esim-topup__esim-tab {
	appearance: none;
	border: 0;
	background: transparent;
	color: #4b5563;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	padding: 12px 10px;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.esim-topup__esim-tab:hover {
	color: #111827;
}

.esim-topup__esim-tab.is-active {
	background: #fff;
	color: #111827;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.esim-topup__esim-panels {
	min-height: 180px;
}

.esim-topup__esim-panel[hidden] {
	display: none !important;
}

.esim-topup__panel-box {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 200px;
	padding: 28px 20px;
	border-radius: 16px;
	border: 1px solid #f3e7c8;
	background: linear-gradient(90deg, #fff8e8 0%, #eefaf6 100%);
	text-align: center;
}

.esim-topup__panel-box--consumption {
	align-items: stretch;
	text-align: left;
	padding: 22px;
}

.esim-topup__panel-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
}

.esim-topup__panel-icon {
	display: inline-flex;
	color: #9ca3af;
}

.esim-topup__panel-placeholder-text,
.esim-topup__topup-copy {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 500;
	color: #6b7280;
}

.esim-topup__topup-copy {
	color: #374151;
	margin-bottom: 4px;
}

.esim-topup__panel-box--topup .esim-topup__btn {
	min-width: 160px;
	border-radius: 999px;
	box-shadow: 0 6px 16px rgba(19, 168, 158, 0.28);
}

.esim-topup__qr-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.esim-topup__qr-wrap img {
	width: min(240px, 100%);
	height: auto;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	padding: 12px;
}

.esim-topup__qr-hint {
	margin: 0;
	font-size: 0.875rem;
	color: #6b7280;
}

.esim-topup__qr-manual {
	width: 100%;
	text-align: left;
	font-size: 0.8125rem;
	color: #6b7280;
}

.esim-topup__qr-manual code {
	display: block;
	margin-top: 8px;
	padding: 12px;
	border-radius: 8px;
	background: #f9fafb;
	word-break: break-all;
	font-size: 0.75rem;
}

/* Consumption panel */
.esim-topup-consumption-panel__usage {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.esim-topup-consumption-panel__usage-label {
	font-size: 0.95rem;
	font-weight: 500;
	color: #1f2937;
}

.esim-topup-consumption-panel__usage-value {
	font-size: 0.95rem;
	font-weight: 700;
	color: #111827;
}

.esim-topup-consumption-panel__bar {
	width: 100%;
	height: 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(19, 168, 158, 0.12);
	overflow: hidden;
	margin-bottom: 16px;
}

.esim-topup-consumption-panel__bar-fill {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #9fe0d6 0%, #13a89e 100%);
	transition: width 0.35s ease;
}

.esim-topup-consumption-panel__stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.esim-topup-consumption-panel__stat {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 14px;
	border-radius: 14px;
	background: #e7f7f1;
}

.esim-topup-consumption-panel__stat-value {
	font-size: 1.125rem;
	font-weight: 700;
	color: #0f766e;
	line-height: 1.2;
	word-break: break-word;
}

.esim-topup-consumption-panel__stat-label {
	font-size: 0.8125rem;
	font-weight: 500;
	color: #6b7280;
}

/* Legacy ring (unused by new panel; keep minimal) */
.esim-topup-consumption {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.esim-topup-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.esim-topup-modal[hidden] {
	display: none;
}

.esim-topup-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
}

.esim-topup-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 720px;
	max-height: 90vh;
	overflow: auto;
	background: #fff;
	border-radius: 16px;
	padding: 28px 24px 24px;
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

.esim-topup-modal__close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	color: #9ca3af;
}

.esim-topup-modal__title {
	margin: 0 0 20px;
	font-size: 1.25rem;
}

.esim-topup-modal__body .esim-topup__plans-list {
	grid-template-columns: 1fr;
}

/* Result */
.esim-topup__card--result {
	text-align: center;
}

.esim-topup__result-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2rem;
	font-weight: 700;
}

.esim-topup__card--success .esim-topup__result-icon {
	background: #dcfce7;
	color: #16a34a;
}

.esim-topup__card--error .esim-topup__result-icon {
	background: #fee2e2;
	color: #dc2626;
}

.esim-topup__card--neutral .esim-topup__result-icon {
	background: #f3f4f6;
	color: #6b7280;
}

.esim-topup__result-details {
	text-align: left;
	margin: 24px 0;
	padding: 16px;
	background: #f9fafb;
	border-radius: 10px;
}

.esim-topup__result-details div {
	margin-bottom: 10px;
}

.esim-topup__result-details dt {
	font-size: 0.75rem;
	color: #9ca3af;
}

.esim-topup__result-details dd {
	margin: 2px 0 0;
	font-weight: 600;
}

.esim-topup__hint {
	font-size: 0.85rem;
	color: #9ca3af;
	margin: -8px 0 16px;
}

.esim-topup__loading {
	text-align: center;
	padding: 32px;
	color: #6b7280;
}

@media (max-width: 640px) {
	.esim-topup {
		padding: 28px 16px 56px;
	}

	.esim-topup--dashboard {
		border-radius: 0;
	}

	.esim-topup__header {
		flex-direction: column;
		align-items: stretch;
	}

	.esim-topup__header .esim-topup__btn--logout,
	.esim-topup__header .esim-topup__btn--outline {
		align-self: flex-end;
	}

	.esim-topup__esim-summary-top {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.esim-topup__view-details {
		align-self: flex-end;
	}

	.esim-topup__supported-countries {
		flex-direction: column;
		align-items: flex-start;
	}

	.esim-topup__supported-countries-codes {
		justify-content: flex-start;
	}

	.esim-topup__esim-tabs {
		gap: 4px;
		padding: 4px;
	}

	.esim-topup__esim-tab {
		padding: 10px 6px;
		font-size: 0.75rem;
	}

	.esim-topup-consumption-panel__stats {
		grid-template-columns: 1fr;
	}

	.esim-topup__card {
		padding: 20px;
	}
}
