/**
 * Auth Modals - Shared CSS
 * Common styles for login, signup, forgot password modals
 * Used across all pages: homepage, list, detail, contact, customer, activity
 */

/* ============================================
   MODAL BASE STYLES
   ============================================ */

.modal {
	display: none;
	position: fixed;
	z-index: 1050;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.4);
}

.modal-dialog,
.modal-dialog1 {
	position: relative;
	margin: auto;
	top: 50%;
	transform: translateY(-50%);
	max-width: 500px;
}

.modal-content {
	background-color: white;
	padding: 20px 30px;
	border-radius: 20px;
	width: 565px;
	max-width: fit-content;
	margin: 0 auto;
}

.modal-header {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.modal-header .close {
	position: absolute;
	right: 15px;
	top: 10px;
	font-size: 28px;
	font-weight: bold;
	color: #aaa;
	background: none;
	border: none;
	cursor: pointer;
	z-index: 10;
}

.modal-header .close:hover {
	color: #333;
}

.modal-content img {
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 15px;
	max-width: 50%;
	height: auto;
}

.modal-body {
	position: relative;
	flex: 1 1 auto;
	padding: 0.5rem 1rem 1rem;
}

.modal-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	padding: 0.75rem;
	border-bottom-right-radius: calc(0.3rem - 1px);
	border-bottom-left-radius: calc(0.3rem - 1px);
}

/* ============================================
   FORM STYLES
   ============================================ */

.form-group {
	margin-bottom: 18px;
}

.form-group label {
	display: block;
	font-size: 14px;
	color: #333;
	margin-bottom: 8px;
	font-weight: 500;
}

label {
	display: inline-block;
	margin-bottom: 0.5rem;
}

/* Form Row Layout - Phone number fields side by side */
.form-row {
	display: flex;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	gap: 10px;
	margin-bottom: 15px;
	align-items: stretch;
}

.form-row > .col,
.form-row > [class*="col-"] {
	padding-right: 5px;
	padding-left: 5px;
}

.form-row .col-3,
.form-row .col-9 {
	flex: none;
}

.form-row .col-3 {
	width: auto;
	min-width: 90px;
	max-width: 100px;
	flex: 0 0 auto;
}

.form-row .col-9 {
	width: auto;
	flex: 1 1 auto;
}

/* General col-3 kept for compatibility */

/* Phone number row - country code compact, phone input flexible */
.form-row .col-3 .custom-select,
.form-row .col-3 select {
	width: 100%;
	min-width: 80px;
}

.form-row select,
.form-row input {
	width: 100%;
	height: 54px;
	padding: 12px 14px;
	box-sizing: border-box;
}

/* Input and Select Styling */
.custom-select,
.form-control {
	height: 54px;
	width: 100%;
	padding: 12px 14px;
	font-size: 16px;
	border: 1px solid #ddd;
	border-radius: 12px;
	box-sizing: border-box;
	transition: border-color 0.3s ease;
	margin: 0;
}

.custom-select:focus,
.form-control:focus {
	border-color: #ed1c24c7;
	outline: none;
	box-shadow: 0 0 5px rgba(237, 28, 36, 0.3);
}

.custom-select {
	appearance: none;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E")
		no-repeat right 10px center;
	background-color: white;
	background-size: 12px;
	padding-right: 30px;
}

/* Input Group Styling */
.input-group {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	width: 100%;
}

.input-group > .custom-file,
.input-group > .custom-select,
.input-group > .form-control,
.input-group > .form-control-plaintext {
	position: relative;
	flex: 1 1 auto;
	width: 1%;
	min-width: 0;
	margin-bottom: 0;
}

.input-group-append {
	display: flex;
	margin-left: -1px;
}

/* Password field with eye icon - left rounded, right straight */
.input-group .form-control {
	border-radius: 12px 0 0 12px;
}

.input-group-text {
	display: flex;
	align-items: center;
	padding: 0 14px;
	border: 1px solid #ddd;
	border-left: none;
	border-radius: 0 12px 12px 0;
	background-color: #f8f9fa;
	cursor: pointer;
	transition: background-color 0.3s ease;
	height: 54px;
}

.input-group-text:hover {
	background-color: #e9ecef;
}

.input-group-text i {
	font-size: 18px;
	color: #666;
}

/* ============================================
   CHECKBOX STYLING
   ============================================ */

.form-check {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	justify-content: space-between;
}

.form-check-input {
	width: 18px;
	height: 18px;
	margin-top: 0;
}

.form-check-label {
	font-size: 14px;
	color: #333;
}

/* ============================================
   BUTTONS & LINKS
   ============================================ */

.modal-button-register {
	background-color: #ed1c24c7 !important;
	color: white !important;
	width: 100%;
	border-radius: 999px !important;
	height: 50px;
	border: none;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.modal-button-register:hover {
	background-color: #c7161e !important;
}

.sign-up {
	cursor: pointer;
	color: #ed1c24c7;
}

.sign-up:hover {
	text-decoration: underline;
}

/* Forget Password Link */
.forget-password {
	font-size: 14px;
	color: #ed1c24c7;
	cursor: pointer;
}

.forget-password:hover {
	text-decoration: none;
	color: #c7161e;
}

/* Sign Up Policy */
.sign-up-policy {
	font-size: 12px;
	color: #666;
	text-align: center;
}

.term-of-service-policy {
	color: #ed1c24c7;
	cursor: pointer;
}

.term-of-service-policy:hover {
	text-decoration: underline;
}

/* ============================================
   VALIDATION FEEDBACK
   ============================================ */

.invalid-feedback {
	display: none;
	font-size: 12px;
	color: #dc3545;
	margin-top: 5px;
}

.form-control:invalid + .invalid-feedback,
.form-control:invalid ~ .invalid-feedback {
	display: block;
}

/* ============================================
   MODAL HEADER CONTENT
   ============================================ */

.header-h6-medium {
	font-size: 22px;
	font-weight: 500;
	text-align: center;
	color: #333;
	line-height: 1.4;
	margin-bottom: 10px;
}

/* Signup modal features section */
.sc-hiwPVj {
	text-align: center;
	margin-top: 10px;
}

.sc-ehCJOs {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-top: 10px;
}

.sc-ehCJOs .item {
	display: flex;
	flex-direction: column;
	align-items: center;
	font-size: 12px;
	gap: 5px;
}

.sc-ehCJOs .item img {
	width: 40px;
	height: 40px;
}

/* ============================================
   PURE MODAL WRAPPER (JavaScript created)
   ============================================ */

#pureModalWrapper {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1050;
	display: flex;
	justify-content: center;
	align-items: center;
}

#pureModalBackdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 1;
}

#pureModalContainer {
	position: relative;
	z-index: 2;
	max-width: 500px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
}

/* ============================================
   MAINTENANCE MODAL (LARGER)
   ============================================ */

.modal-dialog.modal-lg {
	max-width: 650px;
	top: 0;
	transform: none;
	margin: 80px auto;
}

.modal-dialog.modal-lg .modal-content {
	width: 100%;
	max-width: 650px;
}

.modal-dialog.modal-lg .modal-body {
	max-height: 70vh;
	overflow-y: auto;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
	.modal-content {
		width: 95%;
		max-width: 100%;
		border-radius: 20px;
	}

	.modal-dialog,
	.modal-dialog1 {
		max-width: 95%;
		margin: 10px auto;
	}

	.modal-dialog.modal-lg {
		max-width: 95%;
		margin: 20px auto;
	}
}

/* Only stack form fields on very small screens */
@media (max-width: 400px) {
	.form-row {
		flex-direction: column !important;
		gap: 10px;
	}

	.form-row .col-3,
	.form-row .col-9 {
		width: 100% !important;
		flex: 1 1 100% !important;
	}

	.custom-select,
	.form-control {
		font-size: 14px;
	}

	.sc-ehCJOs {
		flex-direction: column;
		gap: 10px;
	}

	.hide-on-mobile {
		display: none !important;
	}
}

@media (max-width: 576px) {
	.modal-content {
		padding: 10px;
	}

	.modal-header {
		gap: 15px;
	}

	.header-h6-medium {
		font-size: 14px;
	}
}

/* ============================================
   AUTH MODAL ISOLATION (PREVENT PAGE CSS OVERRIDE)
   ============================================ */

#auth-modals-component #myModal,
#auth-modals-component #signUpModal {
	display: none;
	position: fixed;
	z-index: 1050;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.4);
}

#auth-modals-component .modal-dialog,
#auth-modals-component .modal-dialog1 {
	position: relative;
	margin: auto;
	top: 50%;
	transform: translateY(-50%);
	max-width: 500px;
}

#auth-modals-component .modal-content {
	background-color: white;
	padding: 20px 30px !important;
	border-radius: 20px !important;
	width: 565px;
	max-width: fit-content;
	margin: 0 auto;
}

#auth-modals-component .modal-header {
	display: flex !important;
	flex-direction: column;
	gap: 24px;
}

#auth-modals-component .modal-body {
	position: relative;
	flex: 1 1 auto;
	padding: 0.5rem 1rem 1rem;
}

#auth-modals-component .modal-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	padding: 0.75rem;
	border-top: 0;
}

#auth-modals-component .form-row {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	gap: 10px;
	margin-bottom: 15px;
	align-items: stretch;
}

#auth-modals-component .form-row .col-3 {
	width: auto !important;
	min-width: 90px;
	max-width: 100px;
	flex: 0 0 auto;
}

#auth-modals-component .form-row .col-9 {
	width: auto !important;
	flex: 1 1 auto;
}

#auth-modals-component .custom-select,
#auth-modals-component .form-control {
	height: 54px;
	width: 100%;
	padding: 12px 14px;
	font-size: 16px;
	border: 1px solid #ddd;
	border-radius: 12px;
	box-sizing: border-box;
	margin: 0;
}

#auth-modals-component .input-group {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	width: 100%;
}

#auth-modals-component .input-group .form-control {
	border-radius: 12px 0 0 12px;
}

#auth-modals-component .input-group-text {
	display: flex;
	align-items: center;
	padding: 0 14px;
	border: 1px solid #ddd;
	border-left: none;
	border-radius: 0 12px 12px 0;
	background-color: #f8f9fa;
	cursor: pointer;
	transition: background-color 0.3s ease;
	height: 54px;
}

@media (max-width: 768px) {
	#auth-modals-component .modal-content {
		width: 95%;
		max-width: 100%;
		border-radius: 20px !important;
	}

	#auth-modals-component .modal-dialog,
	#auth-modals-component .modal-dialog1 {
		max-width: 95%;
		margin: 10px auto;
	}
}
