/**
 * Frontend styles for Mobile OTP Login.
 * Premium, mobile-first design.
 */

:root {
	--motp-primary: #4f46e5;
	--motp-primary-hover: #4338ca;
	--motp-bg: #ffffff;
	--motp-text: #1f2937;
	--motp-text-muted: #6b7280;
	--motp-border: #e5e7eb;
	--motp-error: #ef4444;
	--motp-success: #10b981;
	--motp-radius: 12px;
	--motp-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Standalone Full-Page Layout */
body.mobile-otp-standalone-body {
	background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	margin: 0;
	padding: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	box-sizing: border-box;
}

body.mobile-otp-standalone-body * {
	box-sizing: border-box;
}

/* Main Container Card */
.mobile-otp-container {
	width: 100%;
	max-width: 420px;
	background: var(--motp-bg);
	padding: 35px 30px;
	border-radius: var(--motp-radius);
	box-shadow: var(--motp-shadow);
	margin: 0 auto;
	box-sizing: border-box;
}

/* Header Description */
.mobile-otp-header {
	text-align: center;
	margin-bottom: 25px;
}

.mobile-otp-header h2 {
	margin: 0 0 8px 0;
	font-size: 24px;
	font-weight: 700;
	color: var(--motp-text);
}

.mobile-otp-header p {
	margin: 0;
	font-size: 14px;
	color: var(--motp-text-muted);
	line-height: 1.5;
}

/* Input Fields */
.mobile-otp-input-group {
	margin-bottom: 20px;
	text-align: left;
}

.mobile-otp-input-group label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--motp-text);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.mobile-otp-input-group input[type="text"],
.mobile-otp-input-group input[type="tel"],
.mobile-otp-input-group input[type="email"] {
	width: 100%;
	padding: 12px 16px;
	font-size: 16px;
	border: 1px solid var(--motp-border);
	border-radius: 8px;
	background-color: #fafafa;
	transition: all 0.2s ease;
	outline: none;
	color: var(--motp-text);
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.mobile-otp-input-group input:focus {
	border-color: var(--motp-primary);
	background-color: #ffffff;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.mobile-otp-input-group .field-desc {
	margin: 6px 0 0 0;
	font-size: 11px;
	color: var(--motp-text-muted);
}

/* Specific styling for OTP digit input */
#otp_code_input {
	text-align: center;
	letter-spacing: 6px;
	font-size: 20px;
	font-weight: 700;
}

/* Button & Loading Animation */
.mobile-otp-btn {
	width: 100%;
	padding: 13px;
	font-size: 15px;
	font-weight: 600;
	color: #ffffff;
	background-color: var(--motp-primary);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
	box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.mobile-otp-btn:hover {
	background-color: var(--motp-primary-hover);
	box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.3);
}

.mobile-otp-btn:active {
	transform: translateY(1px);
}

.mobile-otp-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	pointer-events: none;
}

.btn-loader {
	width: 18px;
	height: 18px;
	border: 2px solid #ffffff;
	border-bottom-color: transparent;
	border-radius: 50%;
	display: inline-block;
	animation: motp-rotation 1s linear infinite;
	margin-left: 10px;
}

@keyframes motp-rotation {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Verification Step UI elements */
.mobile-otp-phone-display {
	background: #f9fafb;
	border: 1px solid var(--motp-border);
	padding: 12px;
	border-radius: 8px;
	font-size: 14px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.mobile-otp-phone-display .number-label {
	color: var(--motp-text-muted);
}

.mobile-otp-phone-display .number-val {
	color: var(--motp-text);
}

.mobile-otp-link {
	color: var(--motp-primary);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.2s;
}

.mobile-otp-link:hover {
	color: var(--motp-primary-hover);
	text-decoration: underline;
}

.mobile-otp-link.disabled {
	color: var(--motp-text-muted);
	pointer-events: none;
	text-decoration: none;
}

.otp-expiry-countdown {
	margin-top: 8px;
	font-size: 12px;
	color: var(--motp-text-muted);
	display: flex;
	justify-content: space-between;
}

.otp-expiry-countdown span {
	font-weight: 600;
	color: var(--motp-error);
}

.otp-resend-wrapper {
	margin-top: 15px;
	text-align: center;
	font-size: 13px;
}

.otp-resend-wrapper .resend-label {
	color: var(--motp-text-muted);
	margin-right: 5px;
}

/* Alert Notification Banners */
.mobile-otp-alert {
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.5;
	margin-bottom: 20px;
	animation: motp-slide-in 0.3s ease;
}

.mobile-otp-error {
	background-color: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

.mobile-otp-success {
	background-color: #ecfdf5;
	color: #065f46;
	border: 1px solid #6ee7b7;
}

@keyframes motp-slide-in {
	0% { opacity: 0; transform: translateY(-8px); }
	100% { opacity: 1; transform: translateY(0); }
}

/* Avatar Upload Preview */
.mobile-otp-avatar-upload {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 25px;
}

.avatar-preview-wrapper {
	position: relative;
	width: 110px;
	height: 110px;
	margin-bottom: 8px;
}

.avatar-preview {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
	border: 3px solid #ffffff;
}

.avatar-edit {
	position: absolute;
	right: 0;
	bottom: 0;
}

.avatar-edit label {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin-bottom: 0;
	border-radius: 50%;
	background: var(--motp-primary);
	border: 2px solid #ffffff;
	box-shadow: 0 2px 4px rgba(0,0,0,0.12);
	cursor: pointer;
	color: #ffffff;
	transition: all 0.2s ease;
}

.avatar-edit label:hover {
	background: var(--motp-primary-hover);
}

.avatar-edit label::before {
	font-size: 16px;
	line-height: 28px;
}

.avatar-label {
	font-size: 13px;
	color: var(--motp-text-muted);
}

/* Profile Abort wrapper */
.profile-abort-wrapper {
	margin-top: 15px;
	text-align: center;
	font-size: 13px;
}

/* Logged-In User Interface styling */
.mobile-otp-logged-in {
	text-align: center;
	padding: 20px;
	background: var(--motp-bg);
	border-radius: var(--motp-radius);
	box-shadow: var(--motp-shadow);
	max-width: 380px;
	margin: 0 auto;
}

.mobile-otp-logged-in .user-avatar {
	margin-bottom: 12px;
}

.mobile-otp-logged-in .user-avatar img {
	border-radius: 50%;
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.mobile-otp-logged-in p {
	color: var(--motp-text);
	font-size: 15px;
	margin-bottom: 15px;
}

.mobile-otp-logout-btn {
	display: inline-block;
	padding: 8px 20px;
	background-color: #f3f4f6;
	color: #4b5563;
	border-radius: 6px;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	transition: all 0.2s;
}

.mobile-otp-logout-btn:hover {
	background-color: #e5e7eb;
	color: #1f2937;
}
