/**
 * HUD Loan Officer Popup Styles
 * 
 * CSS styles matching the calculator email modals for consistency.
 * Includes responsive design and professional styling.
 */

/* HUD Loan Officer Modal Styles - Specific for HUD Form Only */
#hud-loan-officer-modal {
	position: fixed !important;
	z-index: 99999 !important; /* Higher than other modals */
	left: 0 !important;
	top: 0 !important;
	width: 100% !important;
	height: 100% !important;
	background-color: rgba(0, 0, 0, 0.6) !important;
	justify-content: center !important;
	align-items: center !important;
	backdrop-filter: blur(4px);
	margin: 0 !important;
	padding: 20px !important;
	box-sizing: border-box !important;
	display: none !important; /* Hidden by default */
}

/* Show the HUD loan officer modal when explicitly displayed */
#hud-loan-officer-modal[style*="display: block"] {
	display: flex !important;
}

.hud-loan-officer-modal-content {
	background: #ffffff !important;
	padding: 40px !important;
	border-radius: 12px !important;
	width: 90% !important;
	max-width: 600px !important;
	position: relative !important;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
	max-height: 90vh !important;
	overflow-y: auto !important;
	margin: 0 auto !important;
	transform: none !important;
	left: auto !important;
	top: auto !important;
}

.hud-loan-officer-modal-close {
	position: absolute !important;
	top: 20px !important;
	right: 25px !important;
	font-size: 30px !important;
	font-weight: bold !important;
	cursor: pointer !important;
	color: #999 !important;
	transition: color 0.3s ease !important;
	z-index: 10000 !important;
	line-height: 1 !important;
}

.hud-loan-officer-modal-close:hover {
	color: #333;
}

.hud-modal-header {
    display: flex;
    flex-direction: column;
	text-align: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 2px solid #e8f4fd;
}

.hud-modal-header h3 {
	color: var(--color-blue-5, #2c5aa0);
	margin-bottom: 10px;
	font-size: 1.8rem;
	font-weight: 600;
	line-height: 1.3;
}

.hud-modal-header p {
	color: #556987;
	margin: 0;
	line-height: 1.5;
	font-size: 1.1rem;
}

/* HUD Loan Officer Form */
.hud-loan-officer-form .form-row {
	margin-bottom: 25px;
}

.hud-loan-officer-form .input-group {
	margin-bottom: 0;
}

.hud-loan-officer-form .input-group label {
	display: block;
	margin-bottom: 8px;
	color: var(--color-blue-4, #213163);
	font-weight: 600;
	font-size: 1.35rem;
	line-height: 1.3;
}

.hud-loan-officer-form .input-group select {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e1e5e9;
	border-radius: 8px;
	font-size: 1.2rem;
	background: #ffffff;
	transition: all 0.3s ease;
	box-sizing: border-box;
	appearance: none;
	background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
	padding-right: 40px;
}

.hud-loan-officer-form .input-group select:focus {
	outline: none;
	border-color: var(--color-blue-1, #2c5aa0);
	box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.hud-loan-officer-form .input-group select:disabled {
	background-color: #f8f9fa;
	color: #6c757d;
	cursor: not-allowed;
}

.hud-loan-officer-form .input-help {
	display: block;
	margin-top: 5px;
	font-size: 0.9rem;
	color: #6c757d;
	font-style: italic;
}

/* Form Actions */
.hud-form-actions {
	text-align: center;
	margin-top: 30px;
	display: flex;
	gap: 15px;
	justify-content: center;
	flex-wrap: wrap;
}

.hud-continue-button,
.hud-cancel-button {
	padding: 14px 30px;
	border: none;
	border-radius: 8px;
	font-size: 1.1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-block;
	min-width: 140px;
}

.hud-continue-button {
	background: var(--color-blue-5, #2c5aa0);
	color: white;
	box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
}

.hud-continue-button:hover {
	background: #1e3f73;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

.hud-continue-button:disabled {
	background: #6c757d;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.hud-cancel-button {
	background: #6c757d;
	color: white;
}

.hud-cancel-button:hover {
	background: #545b62;
	transform: translateY(-2px);
}

/* Status Messages */
.hud-loan-officer-status {
	margin-top: 15px;
	text-align: center;
	font-weight: 500;
}

.hud-loan-officer-status .error {
	color: #dc3545;
	background: #f8d7da;
	padding: 10px 15px;
	border-radius: 5px;
	border: 1px solid #f5c6cb;
}

.hud-loan-officer-status .success {
	color: #155724;
	background: #d4edda;
	padding: 10px 15px;
	border-radius: 5px;
	border: 1px solid #c3e6cb;
}

.hud-loan-officer-status .processing {
	color: #856404;
	background: #fff3cd;
	padding: 10px 15px;
	border-radius: 5px;
	border: 1px solid #ffeeba;
}

/* Responsive Design */
@media only screen and (max-width: 768px) {
	.hud-loan-officer-modal-content {
		padding: 25px !important;
		width: 95% !important;
		margin: 10px !important;
	}
	
	.hud-modal-header h3 {
		font-size: 1.5rem;
	}
	
	.hud-loan-officer-form .input-group label {
		font-size: 1.2rem;
	}
	
	.hud-loan-officer-form .input-group select {
		font-size: 1.1rem;
		padding: 10px 14px;
		padding-right: 35px;
	}
	
	.hud-form-actions {
		flex-direction: column;
		align-items: center;
	}
	
	.hud-continue-button,
	.hud-cancel-button {
		width: 100%;
		max-width: 300px;
	}
}

@media only screen and (max-width: 480px) {
	.hud-loan-officer-modal-content {
		padding: 20px !important;
		border-radius: 8px !important;
	}
	
	.hud-modal-header {
		margin-bottom: 20px;
		padding-bottom: 15px;
	}
	
	.hud-modal-header h3 {
		font-size: 1.3rem;
		margin-bottom: 8px;
	}
	
	.hud-modal-header p {
		font-size: 1rem;
	}
	
	.hud-loan-officer-form .form-row {
		margin-bottom: 20px;
	}
}

/* Integration with existing HUD form styles */
.hud-form-container .hud-continue-button,
.hud-calculator .hud-continue-button {
	font-family: inherit;
}

/* Ensure modal appears above other content */
#hud-loan-officer-modal {
	z-index: 999999 !important;
}

/* Animation for modal appearance */
@keyframes hudModalFadeIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

#hud-loan-officer-modal[style*="display: block"] .hud-loan-officer-modal-content {
	animation: hudModalFadeIn 0.3s ease-out;
}
