:root {
	--color-bg: #f0f4f6;
	--color-input-border: #638ac0;
	--color-input-focus: #155bba;
	--color-btn: #155bba;
	--color-btn-hover: #1e70e4;
	--color-text-main: #1e2d35;
	--color-text-muted: #8297b6;
	--color-link: #155bba;
	--font-main: "Poppins", sans-serif;
	--radius-blob: 60% 40% 55% 45% / 50% 60% 40% 50%;
	--radius-input: 10px;
	--radius-btn: 10px;
	--transition: 0.22s ease;
}

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

html,
body {
	height: 100%;
}

body {
	margin: 0;
	padding: 0;
	background-image: url("../img/loginbg.png");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	font-family: var(--font-main);
	background-color: var(--color-bg);
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	overflow-x: hidden;
	position: relative;
}

.login-wrapper {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 55%;
	min-height: 100vh;
}

.login-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 380px;
	gap: 18px;
}

.dm-title {
	font-family: "Righteous", sans-serif;
}

.login-title {
	text-align: center;
}

.input-group {
	display: flex;
	align-items: flex-start;
	width: 100%;
	gap: 12px;
}

.input-wrapper {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.input-wrapper .error {
	margin-top: 4px;
	display: block;
	flex: unset;
}

.input-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 12px;
}

.input-field {
	flex: 1;
	padding: 13px 16px;
	border: 1.5px solid var(--color-input-border);
	border-radius: var(--radius-input);
	background: #ffffff;
	font-family: var(--font-main);
	font-size: 0.95rem;
	color: var(--color-text-main);
	outline: none;
	transition:
		border-color var(--transition),
		box-shadow var(--transition);
}

select.input-field {
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238297b6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	padding-right: 44px;
}

.input-field::placeholder {
	color: var(--color-text-muted);
}

.input-field:focus {
	border-color: var(--color-input-focus);
	box-shadow: 0 0 0 3px rgba(138, 170, 184, 0.18);
}

.btn-login {
	width: 100%;
	padding: 14px;
	background-color: var(--color-btn);
	color: #ffffff;
	font-family: var(--font-main);
	font-size: 1rem;
	font-weight: 700;
	border: none;
	border-radius: var(--radius-btn);
	cursor: pointer;
	letter-spacing: 0.02em;
	transition:
		background-color var(--transition),
		transform var(--transition),
		box-shadow var(--transition);
	margin-top: 4px;
}

.btn-login:hover {
	background-color: var(--color-btn-hover);
	box-shadow: 0 4px 16px rgba(90, 127, 146, 0.28);
	transform: translateY(-1px);
}

.btn-login:active {
	transform: translateY(0);
	box-shadow: none;
}

.forgot-link {
	font-size: 0.85rem;
	color: var(--color-link);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color var(--transition);
}

.forgot-link:hover {
	opacity: 0.75;
}

.signup-text {
	font-size: 0.88rem;
	color: var(--color-text-muted);
	text-align: center;
	margin-top: 8px;
}

.signup-link {
	color: var(--color-link);
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 500;
	transition: opacity var(--transition);
}

.signup-link:hover {
	opacity: 0.75;
}

.home-link {
	font-size: 0.85rem;
	color: var(--color-link);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color var(--transition);
}

.home-link:hover {
	opacity: 0.75;
}

/* Tablet (<=768px) */
@media (max-width: 768px) {
	body {
		justify-content: center;
		align-items: center;
		padding: 24px 20px;
	}

	.login-wrapper {
		width: 100%;
		min-height: auto;
	}

	.login-card {
		max-width: 420px;
	}
}

/* Mobile (<=480px) */
@media (max-width: 480px) {
	body {
		justify-content: center;
		align-items: center;
		padding: 20px 16px;
	}

	.login-wrapper {
		width: 100%;
		min-height: auto;
		padding: 0;
	}

	.login-card {
		width: 100%;
		max-width: 100%;
		gap: 14px;
	}

	.dm-title {
		font-size: 1.6rem;
	}

	.login-title {
		font-size: 1.4rem;
		margin-bottom: 2px;
	}

	.input-group {
		gap: 10px;
	}

	.input-icon {
		margin-top: 13px;
	}

	.input-field,
	select.input-field {
		padding: 13px 14px;
		font-size: 1rem;
	}

	select.input-field {
		padding-right: 40px;
		background-position: right 14px center;
	}

	.btn-login {
		padding: 14px;
		font-size: 1rem;
	}

	.forgot-link,
	.signup-text,
	.home-link {
		font-size: 0.82rem;
	}
}

/* Small Mobile (<=360px) */
@media (max-width: 360px) {
	body {
		padding: 16px 14px;
	}

	.dm-title {
		font-size: 1.4rem;
	}

	.login-title {
		font-size: 1.25rem;
	}

	.input-field,
	select.input-field {
		padding: 12px 12px;
		font-size: 0.95rem;
	}

	select.input-field {
		padding-right: 36px;
		background-position: right 12px center;
	}

	.btn-login {
		padding: 13px;
	}
}

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

.modal-overlay.open {
	display: flex;
}

.otp-modal {
	position: relative;
	background: #ffffff;
	border-radius: 24px;
	padding: 32px 28px 24px;
	max-width: 420px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(15, 40, 80, 0.18);
	animation: modalSlideIn 0.28s ease;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-16px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.otp-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	border: none;
	background: transparent;
	color: #8297b6;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition:
		background 0.2s ease,
		color 0.2s ease;
}

.otp-close:hover {
	background: #f1f5f9;
	color: #1e2d35;
}

.otp-icon-wrap {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(21, 91, 186, 0.1);
	color: var(--color-btn);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	margin-bottom: 16px;
}

.otp-modal h3 {
	font-size: 1.25rem;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 8px;
}

.otp-subtitle {
	color: #8297b6;
	font-size: 0.88rem;
	line-height: 1.5;
	margin-bottom: 20px;
}

.otp-input {
	width: 100%;
	font-size: 1.75rem;
	padding: 14px 12px;
	text-align: center;
	letter-spacing: 0.5em;
	text-indent: 0.5em;
	font-weight: 600;
	color: #1e293b;
	border: 2px solid #cbd5e1;
	border-radius: 10px;
	margin-bottom: 20px;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
	font-family: var(--font-main);
	outline: none;
}

.otp-input::placeholder {
	color: #cbd5e1;
	font-weight: 400;
	letter-spacing: 0.4em;
}

.otp-input:focus {
	border-color: var(--color-btn);
	box-shadow: 0 0 0 3px rgba(21, 91, 186, 0.15);
}

.otp-input.otp-input-error {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.btn-verify,
.btn-resend,
.btn-back {
	width: 100%;
	padding: 12px;
	border-radius: 10px;
	font-family: var(--font-main);
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition:
		background 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;
	border: none;
}

.btn-verify {
	background: var(--color-btn);
	color: #ffffff;
	margin-bottom: 10px;
}

.btn-verify:hover {
	background: var(--color-btn-hover);
	box-shadow: 0 6px 20px rgba(21, 91, 186, 0.28);
	transform: translateY(-1px);
}

.btn-verify:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-resend {
	background: #f1f5f9;
	color: #1e293b;
}

.btn-resend:hover {
	background: #e2e8f0;
}

.btn-resend:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.btn-resend-cooldown,
.btn-resend:disabled {
	background: #f1f5f9;
	color: #94a3b8;
	cursor: not-allowed;
	opacity: 0.75;
}

.btn-resend-cooldown:hover,
.btn-resend:disabled:hover {
	background: #f1f5f9;
	color: #94a3b8;
}

.btn-back {
	background: transparent;
	color: #8297b6;
	margin-top: 6px;
}

.btn-back:hover {
	background: #f1f5f9;
	color: #1e293b;
}

.message-text {
	margin-top: 14px;
	font-size: 0.85rem;
	min-height: 1em;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.message-success {
	color: #16a34a;
}

.message-error {
	color: #dc2626;
}

@media (max-width: 480px) {
	.otp-modal {
		padding: 28px 20px 20px;
	}
	.otp-input {
		font-size: 1.5rem;
		letter-spacing: 0.4em;
		text-indent: 0.4em;
	}
}
