/* Base page styling */
:root {
	--bg: #f5f7fb;
	--card: #ffffff;
	--text: #0f172a;
	--muted: #64748b;
	--primary: #2563eb;
	--primary-soft: rgba(37, 99, 235, 0.12);
	--success: #16a34a;
	--shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
	--radius: 18px;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	background: radial-gradient(circle at top, #f8fafc, #eef2ff 35%, #e2e8f0 100%);
	color: var(--text);
}

.container {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 32px 16px 60px;
}

.logo {
	height: 56px;
	object-fit: contain;
}

.heading {
	margin: 0;
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 700;
	color: #0b1220;
	text-align: center;
}

.input-box {
	width: min(440px, 90vw);
}

#input-num {
	width: 100%;
	padding: 14px 16px;
	border-radius: 12px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	font-size: 16px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#input-num:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 4px var(--primary-soft);
}

.btn button,
#btn {
	padding: 12px 22px;
	border: none;
	border-radius: 999px;
	background: linear-gradient(135deg, #2563eb, #3b82f6);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 12px 30px rgba(37, 99, 235, 0.3);
}

.btn button:hover,
#btn:hover {
	transform: translateY(-1px);
}

.hiding {
	display: none !important;
}

.response-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 1600;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(6px);
}

.response-popup-box {
	position: relative;
	width: min(520px, 92vw);
	max-height: 85vh;
	overflow-y: auto;
	background: var(--card);
	border-radius: var(--radius);
	padding: 24px 22px 20px;
	box-shadow: var(--shadow);
}

.response-popup-close {
	position: absolute;
	top: 10px;
	right: 12px;
	border: none;
	background: transparent;
	font-size: 28px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
}

.response-popup-message {
	margin-top: 10px;
	color: #0f172a;
	font-size: 15px;
	line-height: 1.6;
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: normal;
}

.response-popup-message p {
	margin: 0;
}

/* Modal styling */
.modal {
	display: none;
	position: fixed;
	z-index: 2000;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(6px);
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.modal-content {
	background: var(--card);
	border-radius: var(--radius);
	width: min(520px, 92vw);
	padding: 28px 28px 24px;
	box-shadow: var(--shadow);
	position: relative;
	animation: modalPop 0.25s ease;
	max-height: 90vh;
	overflow-y: auto;
}

@keyframes modalPop {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.modal-content h2 {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
}

#product_title {
	margin: 0 0 12px;
	color: black;
	font-size: clamp(12px, 2.6vw, 14px);
	overflow-wrap: anywhere;
	word-break: break-word;
}

#qr_text {
	margin: 0 0 16px;
	color: #0f172a;
	font-size: clamp(13px, 2.8vw, 15px);
	line-height: 1.5;
	overflow-wrap: anywhere;
	word-break: break-word;
}

#qrcodeContainer {
	margin: 16px auto;
	padding: 14px;
	background: #f8fafc;
	border-radius: 16px;
	box-shadow: inset 0 0 0 1px #e2e8f0;
}

.qr-code-container {
	display: flex;
	justify-content: center;
	align-items: center;
	margin: 20px 0;
}

.close-button {
	position: absolute;
	top: 18px;
	right: 20px;
	font-size: 22px;
	cursor: pointer;
	color: #94a3b8;
	transition: color 0.2s ease;
}

.close-button:hover {
	color: #0f172a;
}

.esim-links {
	margin: 10px 0 18px 0;
	font-size: 15px;
	line-height: 1.4;
	display: grid;
	gap: 10px;
}

.esim-links p {
	margin: 0;
	padding: 10px 12px;
	border-radius: 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.esim-links p::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: #60a5fa;
	box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

.esim-links a {
	display: inline-block;
	max-width: 100%;
	word-break: break-all;
	overflow-wrap: anywhere;
	color: #1d4ed8;
	font-weight: 600;
	text-decoration: none;
	background: rgba(37, 99, 235, 0.08);
	padding: 6px 10px;
	border-radius: 999px;
}

.esim-links a:hover {
	background: rgba(37, 99, 235, 0.16);
}

.button-container {
	display: grid;
	gap: 10px;
	margin: 18px 0 10px;
}

.button-container button {
	padding: 12px 16px;
	border-radius: 12px;
	border: none;
	font-weight: 600;
	cursor: pointer;
	background: #0f172a;
	color: #fff;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button-container button:hover {
	transform: translateY(-1px);
}

#downloadButton {
	background: #0f172a;
}

#setupButton {
	background: linear-gradient(135deg, #16a34a, #22c55e);
	box-shadow: 0 10px 24px rgba(34, 197, 94, 0.35);
}

#setupButtonIos,
#setupButtonAndroid {
	background: linear-gradient(135deg, #16a34a, #22c55e);
	box-shadow: 0 10px 24px rgba(34, 197, 94, 0.35);
}

#closeButton {
	background: #e2e8f0;
	color: #0f172a;
}

.sim-details {
	margin-top: 10px;
	padding: 10px 12px;
	background: #f8fafc;
	border-radius: 12px;
	border: 1px dashed #cbd5f5;
	color: #0f172a;
	font-size: 14px;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.qr-text-value {
	font-weight: 700;
	font-size: 16px;
}

.qr-btn-disabled {
	background-color: #0f766e !important;
	cursor: not-allowed !important;
	white-space: normal;
}

#qr-buttons-container-overlay {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(15, 23, 42, 0.55);
	backdrop-filter: blur(6px);
	z-index: 1500;
}

#qr-buttons-container-overlay.show {
	display: flex;
}

#qr-buttons-container {
	background: var(--card);
	border-radius: var(--radius);
	width: min(520px, 92vw);
	padding: 24px;
	box-shadow: var(--shadow);
	display: grid;
	gap: 10px;
	max-height: 80vh;
	overflow-y: auto;
}

.qr-item-title {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--muted);
	overflow-wrap: anywhere;
	word-break: break-word;
}

.qr-btn {
	width: 100%;
	padding: 12px 16px;
	border-radius: 12px;
	border: none;
	font-weight: 600;
	cursor: pointer;
	background: linear-gradient(135deg, #2563eb, #3b82f6);
	color: #fff;
	text-align: center;
	white-space: normal;
}

.qr-btn:hover {
	transform: translateY(-1px);
}

#qrCloseButton {
	margin-top: 6px;
	background: #e2e8f0;
	color: #0f172a;
	border: none;
	padding: 12px 16px;
	border-radius: 12px;
	font-weight: 600;
	cursor: pointer;
}

ul {
	margin: 14px 0 0;
	padding-left: 18px;
	color: var(--muted);
	font-size: 14px;
}

@media (max-width: 600px) {
	.modal-content {
		padding: 22px 18px 18px;
	}

	.response-popup-box {
		padding: 20px 16px 16px;
	}

	.button-container {
		grid-template-columns: 1fr;
	}

	#qr-buttons-container {
		padding: 20px 16px;
	}
}

