/**
 * Student Registration Form Styles
 * Clean, two-column, responsive layout
 *
 * @package TIS_Members_Directory
 */

/* Reset and Base */
.tis-student-form-wrapper {
	--tis-primary: #2563eb;
	--tis-primary-hover: #1d4ed8;
	--tis-success: #10b981;
	--tis-error: #ef4444;
	--tis-warning: #f59e0b;
	--tis-gray-50: #f9fafb;
	--tis-gray-100: #f3f4f6;
	--tis-gray-200: #e5e7eb;
	--tis-gray-300: #d1d5db;
	--tis-gray-400: #9ca3af;
	--tis-gray-500: #6b7280;
	--tis-gray-600: #4b5563;
	--tis-gray-700: #374151;
	--tis-gray-800: #1f2937;
	--tis-gray-900: #111827;
	--tis-radius: 12px;
	--tis-radius-sm: 8px;

	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	line-height: 1.6;
	color: var(--tis-gray-800);
	max-width: 900px;
	margin: 0 auto;
	padding: 20px;
}

.tis-student-form-wrapper * {
	box-sizing: border-box;
}

/* Form Container */
.tis-student-form {
	background: #fff;
	border: 1px solid var(--tis-gray-200);
	border-radius: var(--tis-radius);
	overflow: hidden;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Header */
.tis-form-header {
	padding: 24px 28px;
	background: var(--tis-gray-50);
	border-bottom: 1px solid var(--tis-gray-200);
	text-align: center;
}

.tis-form-header h2 {
	margin: 0 0 4px;
	font-size: 22px;
	font-weight: 700;
	color: var(--tis-gray-900);
}

.tis-form-header p {
	margin: 0;
	color: var(--tis-gray-500);
	font-size: 14px;
}

/* Two Column Grid */
.tis-form-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}

@media (max-width: 768px) {
	.tis-form-grid {
		grid-template-columns: 1fr;
	}
}

.tis-form-column {
	padding: 24px 28px;
}

.tis-form-column:first-child {
	border-right: 1px solid var(--tis-gray-100);
}

@media (max-width: 768px) {
	.tis-form-column {
		padding: 20px;
	}

	.tis-form-column:first-child {
		border-right: none;
		border-bottom: 1px solid var(--tis-gray-100);
		padding-bottom: 24px;
	}

	.tis-form-column:last-child {
		padding-top: 24px;
	}
}

/* Section Headers */
.tis-form-section h3 {
	margin: 0 0 18px;
	font-size: 13px;
	font-weight: 600;
	color: var(--tis-gray-400);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.tis-form-section h3::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--tis-gray-200);
}

/* Form Groups */
.tis-form-group {
	margin-bottom: 18px;
}

.tis-form-group:last-child {
	margin-bottom: 0;
}

.tis-form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	font-size: 14px;
	color: var(--tis-gray-700);
}

.tis-form-group label .required {
	color: var(--tis-error);
	margin-left: 2px;
}

.tis-form-group input[type="text"],
.tis-form-group input[type="email"],
.tis-form-group input[type="tel"],
.tis-form-group input[type="password"],
.tis-form-group textarea {
	width: 100%;
	padding: 10px 14px;
	font-size: 14px;
	border: 1px solid var(--tis-gray-300);
	border-radius: var(--tis-radius-sm);
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	outline: none;
}

.tis-form-group input:focus,
.tis-form-group textarea:focus {
	border-color: var(--tis-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tis-form-group input::placeholder,
.tis-form-group textarea::placeholder {
	color: var(--tis-gray-400);
}

.tis-form-group textarea {
	resize: vertical;
	min-height: 80px;
}

/* Hidden Input */
.tis-hidden-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* Password Wrapper */
.tis-password-wrapper {
	position: relative;
}

.tis-password-wrapper input {
	padding-right: 44px;
}

.tis-toggle-password {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: var(--tis-gray-400);
	transition: color 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tis-toggle-password:hover {
	color: var(--tis-gray-600);
}

/* Password Strength */
.tis-password-strength {
	height: 4px;
	margin-top: 8px;
	border-radius: 2px;
	background: var(--tis-gray-200);
	overflow: hidden;
}

.tis-password-strength::after {
	content: '';
	display: block;
	height: 100%;
	width: 0;
	transition: width 0.25s ease, background 0.25s ease;
}

.tis-password-strength.weak::after {
	width: 25%;
	background: var(--tis-error);
}

.tis-password-strength.fair::after {
	width: 50%;
	background: var(--tis-warning);
}

.tis-password-strength.good::after {
	width: 75%;
	background: #84cc16;
}

.tis-password-strength.strong::after {
	width: 100%;
	background: var(--tis-success);
}

/* Password Requirements */
.tis-password-requirements {
	margin-top: 10px;
}

.tis-password-requirements ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px 12px;
}

.tis-password-requirements li {
	font-size: 12px;
	color: var(--tis-gray-400);
	display: flex;
	align-items: center;
	gap: 5px;
}

.tis-password-requirements li .tis-req-icon {
	font-size: 10px;
	width: 14px;
	text-align: center;
}

.tis-password-requirements li.valid {
	color: var(--tis-success);
}

.tis-password-requirements li.valid .tis-req-icon {
	color: var(--tis-success);
}

/* Photo Section */
.tis-photo-section {
	padding: 20px 28px;
	border-top: 1px solid var(--tis-gray-100);
	background: var(--tis-gray-50);
}

@media (max-width: 768px) {
	.tis-photo-section {
		padding: 20px;
	}
}

.tis-photo-upload-group {
	display: flex;
	align-items: center;
	gap: 16px;
}

.tis-photo-preview {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--tis-primary) 0%, var(--tis-primary-hover) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
	border: 3px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.tis-photo-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tis-photo-initials {
	font-size: 22px;
	font-weight: 600;
	color: #fff;
	text-transform: uppercase;
}

.tis-photo-upload-controls {
	flex: 1;
}

.tis-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #fff;
	border: 1px solid var(--tis-gray-300);
	border-radius: var(--tis-radius-sm);
	font-size: 13px;
	font-weight: 500;
	color: var(--tis-gray-700);
	cursor: pointer;
	transition: all 0.15s ease;
}

.tis-upload-btn:hover {
	border-color: var(--tis-primary);
	color: var(--tis-primary);
}

.tis-photo-hint {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--tis-gray-500);
}

/* Form Footer */
.tis-form-footer {
	padding: 20px 28px;
	border-top: 1px solid var(--tis-gray-100);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

@media (max-width: 768px) {
	.tis-form-footer {
		padding: 20px;
		flex-direction: column;
		align-items: stretch;
	}
}

/* Consent Checkbox */
.tis-consent-group {
	flex: 1;
}

.tis-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 13px;
}

.tis-checkbox-label input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.tis-checkbox-custom {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	border: 1px solid var(--tis-gray-300);
	border-radius: 4px;
	background: #fff;
	transition: all 0.15s ease;
	position: relative;
	margin-top: 2px;
}

.tis-checkbox-label input:checked + .tis-checkbox-custom {
	background: var(--tis-primary);
	border-color: var(--tis-primary);
}

.tis-checkbox-custom::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
	transition: opacity 0.15s ease;
}

.tis-checkbox-label input:checked + .tis-checkbox-custom::after {
	opacity: 1;
}

.tis-consent-text {
	color: var(--tis-gray-600);
	line-height: 1.5;
}

/* Field Errors */
.tis-field-error {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	color: var(--tis-error);
}

/* Submit Button */
.tis-submit-btn {
	padding: 12px 28px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: var(--tis-primary);
	border: none;
	border-radius: var(--tis-radius-sm);
	cursor: pointer;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	white-space: nowrap;
	flex-shrink: 0;
}

.tis-submit-btn:hover:not(:disabled) {
	background: var(--tis-primary-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.tis-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

@media (max-width: 768px) {
	.tis-submit-btn {
		width: 100%;
		padding: 14px 24px;
	}
}

.tis-btn-loading {
	display: flex;
	align-items: center;
	gap: 8px;
}

.tis-spinner {
	animation: tis-spin 1s linear infinite;
}

@keyframes tis-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* Form Messages */
.tis-form-message {
	margin: 16px 28px;
	padding: 14px 16px;
	border-radius: var(--tis-radius-sm);
	font-size: 14px;
}

@media (max-width: 768px) {
	.tis-form-message {
		margin: 16px 20px;
	}
}

.tis-form-message.success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.tis-form-message.error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Focus states for accessibility */
.tis-submit-btn:focus-visible,
.tis-upload-btn:focus-visible,
.tis-toggle-password:focus-visible {
	outline: 2px solid var(--tis-primary);
	outline-offset: 2px;
}

.tis-checkbox-label input:focus-visible + .tis-checkbox-custom {
	outline: 2px solid var(--tis-primary);
	outline-offset: 2px;
}

/* Smooth transitions */
.tis-form-group input,
.tis-form-group textarea,
.tis-submit-btn,
.tis-upload-btn,
.tis-checkbox-custom {
	transition: all 0.2s ease;
}
