
/* Patient Registration Form Styles */
.registration-container {
	max-width: 64rem;
	margin: 0 auto;
	background-color: rgb(31 41 55);
	border-radius: 0.75rem;
	box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
	padding: 2rem;
	border: 1px solid rgb(55 65 81);
}

.registration-header {
	margin-bottom: 2rem;
}

.registration-logo {
	height: 3rem;
	width: 3rem;
}

.registration-title {
	font-size: 1.875rem;
	line-height: 2.25rem;
	font-weight: 700;
}

.registration-subtitle {
	color: rgb(156 163 175);
}

.form-group {
	margin-bottom: 1.5rem;
}

.form-label {
	display: block;
	font-size: 0.875rem;
	line-height: 1.25rem;
	font-weight: 500;
	color: rgb(209 213 219);
	margin-bottom: 0.5rem;
}

.form-input {
	width: 100%;
	padding: 0.5rem 1rem;
	background-color: rgb(55 65 81);
	border: 1px solid rgb(75 85 99);
	border-radius: 0.5rem;
	color: rgb(243 244 246);
}

.form-input:focus {
	outline: 2px solid rgb(59 130 246);
	outline-offset: 2px;
}

/* Phone number validation styles */
.form-input.phone-exists {
	border-color: rgb(239 68 68);
	box-shadow: 0 0 0 1px rgb(239 68 68);
}

.form-input.phone-new {
	border-color: rgb(34 197 94);
	box-shadow: 0 0 0 1px rgb(34 197 94);
}

.form-input.phone-checking {
	border-color: rgb(251 191 36);
	box-shadow: 0 0 0 1px rgb(251 191 36);
}

.phone-status {
	font-size: 0.75rem;
	margin-top: 0.25rem;
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.phone-status.exists {
	color: rgb(239 68 68);
}

.phone-status.new {
	color: rgb(34 197 94);
}

.phone-status.checking {
	color: rgb(251 191 36);
}

/* Patient info display styles */
.patient-info {
	margin-top: 0.5rem;
	padding: 0.75rem;
	background-color: rgba(239, 68, 68, 0.1);
	border: 1px solid rgb(239 68 68);
	border-radius: 0.5rem;
}

.patient-info-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.patient-details {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 1;
}

.patient-info-icon {
	color: rgb(239 68 68);
	font-size: 1.25rem;
}

.patient-text {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.patient-label {
	font-size: 0.75rem;
	color: rgb(239 68 68);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

.patient-name-id {
	font-size: 0.875rem;
	color: rgb(243 244 246);
	font-weight: 500;
}

.patient-login-btn {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.5rem 0.75rem;
	background-color: rgb(239 68 68);
	color: white;
	border: none;
	border-radius: 0.375rem;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.patient-login-btn:hover {
	background-color: rgb(220 38 38);
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

.patient-login-btn:active {
	transform: translateY(0);
}

@media (max-width: 640px) {
	.patient-info-content {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.patient-login-btn {
		justify-content: center;
	}
}

.form-input::placeholder {
	color: rgb(156 163 175);
}

.form-hint {
	font-size: 0.875rem;
	color: rgb(156 163 175);
	margin-top: 0.25rem;
}

.form-error {
	color: rgb(239 68 68);
	font-size: 0.875rem;
	margin-top: 0.25rem;
}

.form-checkbox {
	height: 1rem;
	width: 1rem;
	color: rgb(37 99 235);
}

.consent-link {
	text-decoration: underline;
	color: rgb(96 165 250);
}

.consent-link:hover {
	color: rgb(59 130 246);
}

.btn {
	width: 100%;
	padding: 0.5rem 1rem;
	border-radius: 0.5rem;
	transition-property: color, background-color;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
	transition-duration: 200ms;
}

.btn-primary {
	background-color: rgb(37 99 235);
	color: white;
}

.btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-secondary {
	background-color: rgb(75 85 99);
	color: white;
}

.btn-secondary:hover {
	background-color: rgb(55 65 81);
}

.alert {
	margin-bottom: 1rem;
	padding: 0.75rem;
	border-radius: 0.5rem;
}

.alert-success {
	background-color: rgb(22 163 74);
	color: white;
}

.alert-error {
	background-color: rgb(220 38 38);
	color: white;
}

.grid-2-cols {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 1.5rem;
}

@media (min-width: 768px) {
	.grid-2-cols {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
/* Ensure first and last name stack on narrower screens */
@media (max-width: 768px) {
   .grid-2-cols {
	   grid-template-columns: 1fr !important;
   }
}

.flex-row {
	display: flex;
	flex-direction: row;
	gap: 1rem;
}

.flex-1 {
	flex: 1;
}

.registration-layout {
	display: flex;
	gap: 2rem;
	align-items: flex-start;
}

.registration-main {
	flex: 1;
}

.consultation-info {
	background: rgba(255, 255, 255, 0.05);
	border-radius: 12px;
	padding: 1.5rem;
	margin-bottom: 2rem;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.consultation-details {
	display: flex;
	gap: 2rem;
	justify-content: flex-start;
	align-items: center;
}

.detail-item {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.detail-icon {
	font-size: 1.5rem;
	color: #60a5fa;
	background: rgba(96, 165, 250, 0.1);
	padding: 0.75rem;
	border-radius: 50%;
}

.detail-text {
	display: flex;
	flex-direction: column;
}

.detail-label {
	font-size: 0.875rem;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.detail-value {
	font-size: 1.125rem;
	color: #f3f4f6;
	font-weight: 500;
}

@media (max-width: 640px) {
	.consultation-details {
		flex-direction: column;
		gap: 1rem;
		align-items: flex-start;
	}
}

/* Multiple patients display styles */
.multiple-patients {
	margin-top: 0.75rem;
	padding: 1rem;
	background-color: rgba(37, 99, 235, 0.1);
	border: 1px solid rgb(75 85 99);
	border-radius: 0.5rem;
}

.multiple-patients-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
	color: rgb(96 165 250);
	font-weight: 500;
	font-size: 0.875rem;
}

.multiple-patients-header i {
	font-size: 1rem;
}

.patients-list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.patient-card {
	padding: 0.75rem;
	background-color: rgba(55, 65, 81, 0.5);
	border: 1px solid rgb(75 85 99);
	border-radius: 0.5rem;
	transition: all 0.2s ease;
}

.patient-card:hover {
	background-color: rgba(55, 65, 81, 0.8);
	border-color: rgb(107 114 128);
}

.patient-card-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
}

.patient-details {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 1;
}

.patient-card-icon {
	color: rgb(96 165 250);
	font-size: 1.125rem;
}

.patient-text {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.patient-text strong {
	color: rgb(243 244 246);
	font-size: 0.875rem;
}

.patient-id,
.patient-email {
	color: rgb(156 163 175);
	font-size: 0.75rem;
}

.patient-login-btn {
	padding: 0.5rem 1rem;
	background-color: rgb(59 130 246);
	color: white;
	border: none;
	border-radius: 0.375rem;
	font-size: 0.75rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	gap: 0.375rem;
	white-space: nowrap;
}

.patient-login-btn:hover {
	background-color: rgb(37 99 235);
	transform: translateY(-1px);
}

.patient-login-btn:active {
	transform: translateY(0);
}

@media (max-width: 640px) {
	.patient-card-content {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
	}

	.patient-login-btn {
		justify-content: center;
	}
}

@media (max-width: 1024px) {
	.registration-layout {
		flex-direction: column;
	}
}

/* --- Begin migrated rules from mobile_fixes.css --- */
/* Mobile Responsiveness Fixes for Patient Registration */

/* Fix DOB/Age container width on mobile */
@media (max-width: 640px) {
	.flex.gap-4.w-full.max-w-md {
		max-width: 100% !important;
	}

	/* Ensure DOB and Age inputs are properly sized on mobile */
	.flex.gap-4.w-full.max-w-md .w-1\/2 {
		min-width: 120px;
		flex: 1;
	}

	/* Improve spacing for DOB/Age section */
	.flex.gap-4.w-full.max-w-md {
		gap: 0.75rem !important;
	}
}

/* Fix button layout on mobile */
@media (max-width: 640px) {
	/* Ensure buttons are properly sized and spaced */
	.flex.flex-col.md\:flex-row.gap-4.pt-2 {
		gap: 0.75rem !important;
	}

	.flex.flex-col.md\:flex-row.gap-4.pt-2 .btn {
		min-height: 44px; /* iOS touch target minimum */
		width: 100% !important;
	}

	/* Improve button container spacing */
	.flex.flex-col.md\:flex-row.gap-4.pt-2 {
		margin-top: 1rem;
	}
}

/* Improve form input spacing on mobile */
@media (max-width: 640px) {
	.form-group {
		margin-bottom: 1.25rem;
	}

	.form-input {
		min-height: 44px; /* Better touch targets */
		font-size: 16px; /* Prevent zoom on iOS */
	}

	/* Improve label spacing */
	.form-label {
		margin-bottom: 0.375rem;
		font-size: 0.875rem;
	}
}

	/* Accessibility and sizing fixes for small screens */
	@media (max-width: 640px) {
		/* Ensure registration container uses available width and includes box-sizing */
		.registration-container {
			width: calc(100% - 1rem) !important;
			box-sizing: border-box;
		}

		/* Make inputs and interactive controls large enough for touch and fill their column */
		.form-input,
		input[type="text"],
		input[type="tel"],
		input[type="email"],
		input[type="password"],
		textarea,
		select,
		.btn,
		button {
			min-height: 44px !important;
			height: auto !important;
			width: 100% !important;
			display: block !important;
			box-sizing: border-box !important;
			padding-left: 0.75rem !important;
			padding-right: 0.75rem !important;
		}

		/* Allow side-by-side DOB/Age children to shrink properly on very narrow screens */
		.flex.gap-4.w-full.max-w-md .w-1\/2 {
			min-width: 0 !important;
			flex: 1 1 0% !important;
		}

		/* Prevent zero-width buttons from collapsing; make them visible and tappable */
		button[hidden], button[style*="display:none"] {
			/* keep hidden as-is; don't force display */
		}
	}

/* Fix registration container padding on mobile */
@media (max-width: 640px) {
	.registration-container {
		padding: 1.5rem;
		margin: 0 0.5rem;
		border-radius: 0.5rem;
	}

	/* Improve header layout on mobile */
	.registration-header .flex.items-center.space-x-4 {
		flex-direction: column;
		text-align: center;
		gap: 1rem;
	}

	.registration-header .flex.items-center.space-x-4.mb-4.sm\:mb-0 {
		margin-bottom: 1.5rem;
	}
}

/* Stronger mobile touch-target rules to catch small/zero-size interactive elements */
@media (max-width: 640px) {
	/* Target visible buttons and button-like controls, exclude hidden inputs */
	button:not([hidden]):not([aria-hidden="true"]):not([style*="display:none"]),
	.btn:not([hidden]):not([aria-hidden="true"]) {
		min-width: 64px !important;
		min-height: 44px !important;
		width: auto !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		padding: 0.5rem 0.75rem !important;
		box-sizing: border-box !important;
		overflow: visible !important;
	}

	/* Force inputs and selects to be tappable and full width in forms */
	.registration-container input:not([type="hidden"]):not([disabled]),
	.registration-container textarea:not([disabled]),
	.registration-container select:not([disabled]) {
		min-height: 44px !important;
		height: auto !important;
		width: 100% !important;
		display: block !important;
		padding: 0.5rem 0.75rem !important;
		box-sizing: border-box !important;
	}

	/* Ensure anchors styled as buttons are also tappable */
	a.btn, a.button, a[class*="btn-"] {
		min-height: 44px !important;
		min-width: 64px !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		padding: 0.5rem 0.75rem !important;
		box-sizing: border-box !important;
	}

	/* Catch elements collapsed to zero and ensure they render inside forms */
	form button { display: inline-flex !important; }
	form input { display: block !important; }

	/* Ensure DOB/Age columns can shrink without causing overflow */
	.flex.gap-4.w-full.max-w-md .w-1\/2 {
		min-width: 0 !important;
		flex: 1 1 0% !important;
	}
}

/* Improve consent checkbox layout on mobile */
@media (max-width: 640px) {
	.inline-flex.items-center.space-x-2 {
		align-items: flex-start;
		gap: 0.5rem;
	}

	.inline-flex.items-center.space-x-2 span {
		line-height: 1.4;
		font-size: 0.875rem;
	}
}

/* Fix password section layout on mobile */
@media (max-width: 640px) {
	.flex-row {
		flex-direction: column !important;
		gap: 1rem !important;
	}

	.flex-row .flex-1 {
		width: 100% !important;
	}
}

/* Additional mobile stacking fixes */
@media (max-width: 640px) {
    /* Stack DOB and Age vertically */
    .flex.gap-4.w-full.max-w-md {
        flex-direction: column !important;
    }
    .flex.gap-4.w-full.max-w-md .w-1\/2 {
        width: 100% !important;
    }
    /* Stack password fields vertically */
    .flex-row {
        flex-direction: column !important;
    }
}

/* Improve overall mobile spacing */
@media (max-width: 640px) {
	#patient-registration {
		padding: 1rem 0.5rem;
	}

	.space-y-8 > :not([hidden]) ~ :not([hidden]) {
		margin-top: 1.5rem !important;
	}

	.space-y-4 > :not([hidden]) ~ :not([hidden]) {
		margin-top: 1rem !important;
	}
}

/* Ensure proper viewport handling */
@media (max-width: 480px) {
	.registration-container {
		margin: 0 0.25rem;
		padding: 1rem;
	}

	/* Stack all form elements vertically on very small screens */
	.grid-2-cols {
		grid-template-columns: 1fr !important;
		gap: 1rem !important;
	}
}

/* Desktop / wide-screen improvements - make the container and form stretch */
@media (min-width: 1024px) {
	/* Allow the registration container to expand on large viewports */
	.registration-container {
		max-width: 1200px; /* wider container */
		width: 100%;
		margin: 2rem auto; /* center with side breathing room */
		padding: 2.5rem; /* more padding on desktop */
		border-radius: 0.75rem;
	}

	/* Layout: allow side-by-side panels and let main expand */
	.registration-layout {
		display: flex;
		gap: 2rem;
		align-items: flex-start;
	}

	.registration-main {
		flex: 1 1 auto;
		width: 100%;
	}

	/* Use a two-column grid on desktop for personal info */
	.grid-2-cols {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.5rem;
	}

	/* Make the DOB/Age container use full available width within its column */
	.flex.gap-4.w-full.max-w-md {
		max-width: none !important;
		width: 100%;
	}

	/* Restore horizontal password layout on desktop */
	.flex-row {
		flex-direction: row !important;
		gap: 1rem !important;
	}

	/* Buttons: keep natural width and align horizontally */
	.flex.flex-col.md\:flex-row.gap-4.pt-2 {
		flex-direction: row !important;
		gap: 1rem !important;
	}

	.flex.flex-col.md\:flex-row.gap-4.pt-2 .btn {
		width: auto !important;
		min-width: 160px;
	}

	/* Inputs should remain full width of their column */
	.form-input {
		width: 100%;
	}

	/* Slightly larger typography on desktop for better rhythm */
	.registration-title {
		font-size: 2rem;
		line-height: 2.5rem;
	}
}

/* --- End migrated rules from mobile_fixes.css --- */

/* Target specific small/zero-size elements found by the checker */
@media (max-width: 640px) {
	/* Patient login button found with width 0; make it visible and tappable */
	#patient_login_btn,
	.patient-login-btn {
		min-width: 64px !important;
		min-height: 44px !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		padding: 0.5rem 0.75rem !important;
		box-sizing: border-box !important;
		background-color: rgba(239,68,68,0.9) !important;
		color: #fff !important;
	}

	/* Consent link styled as inline text may be small; make it more tappable */
	a.consent-link {
		display: inline-flex !important;
		align-items: center !important;
		min-height: 36px !important;
		padding: 0.25rem 0.5rem !important;
		box-sizing: border-box !important;
	}
}

/* Mobile patient registration fixes */
@media (max-width: 640px) {
    /* Single column for personal info grid */
    .grid-2-cols {
        grid-template-columns: 1fr !important;
    }
    /* Stack Date of Birth and Age vertically and full width */
    .flex.gap-4.w-full.max-w-md {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    .flex.gap-4.w-full.max-w-md .w-1\/2 {
        width: 100% !important;
    }
    /* Stack Account Security fields vertically */
    .flex-row {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }
    .flex-row .flex-1 {
        width: 100% !important;
    }
    /* Ensure all inputs and buttons take full width */
    .form-input,
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="password"],
    .btn {
        width: 100% !important;
        box-sizing: border-box !important;
    }
    /* Button row adjustment */
    .flex.flex-col.md\:flex-row.gap-4.pt-2 {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    .flex.flex-col.md\:flex-row.gap-4.pt-2 .btn {
        width: 100% !important;
    }
}

/* Stack first and last name on narrow viewports using grid */
@media (max-width: 640px) {
  #personal-info {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }
  /* Ensure each field takes full width */
  #personal-info .form-group {
    width: 100%;
}
}

/* Ensure first name and last name always on separate lines */

@media (max-width: 768px) {
    #personal-info {
        grid-template-columns: 1fr !important;
    }
    
    #personal-info .form-group {
        width: 100% !important;
    }
}


@media (min-width: 769px) {
    #personal-info {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #personal-info .form-group {
        width: 100%;
    }
}
#personal-info .form-group.md\\:col-span-2 {
    grid-column: 1 / -1;
    width: 100%;
}

/* Ensure Address field spans full width */
#personal-info .form-group.md\\:col-span-2:last-child {
    grid-column: 1 / -1;
    width: 100%;
}
/* Unique ID validation status styles */
.unique-id-status {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.unique-id-status.available {
    color: var(--color-success);
}

.unique-id-status.exists {
    color: #ef4444; /* red-500 */
}

.unique-id-status.checking {
    color: #fbbf24; /* amber-400 */
}

.unique-id-status.error {
    color: #dc2626; /* red-600 */
}

/* Border colors for unique ID input */
.form-input.unique-id-available {
    border-color: var(--color-success) !important;
    box-shadow: 0 0 0 1px var(--color-success) !important;
}

.form-input.unique-id-exists {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.form-input.unique-id-checking {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 0 1px #fbbf24 !important;
}

/* Unique ID patient info display */
.unique-id-patient-info {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 0.5rem;
}

.unique-id-patient-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Multiple patients with unique ID */
#multiple_unique_id_patients {
    margin-top: 0.75rem;
    padding: 1rem;
    background-color: rgba(37, 99, 235, 0.1);
    border: 1px solid rgb(75 85 99);
    border-radius: 0.5rem;
}

/* Responsive adjustments for unique ID display */
@media (max-width: 640px) {
    .unique-id-patient-info-content {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
}
