/**
 * Elimu ERP – Portal Access & Registration Stylesheet
 * Colours, fonts and shadows come from Elimu ERP Core's design tokens (--eerp-*), so the school's chosen colours apply automatically.
 */

.eerp-portal-wrap {
	font-family: var(--eerp-font-body);
	color: var(--eerp-text);
	line-height: 1.5;
	box-sizing: border-box;
	margin: 24px auto;
	max-width: 800px;
}

.eerp-portal-wrap * {
	box-sizing: border-box;
}

/* Card Container */
.eerp-card {
	background: var(--eerp-surface);
	border: 1px solid var(--eerp-border);
	border-radius: 12px;
	box-shadow: var(--eerp-shadow-sm);
	padding: 28px;
}

.eerp-card-header {
	margin-bottom: 24px;
	border-bottom: 1px solid var(--eerp-neutral-100);
	padding-bottom: 16px;
}

.eerp-card-title {
	font-family: var(--eerp-font-display);
	font-size: 1.6rem;
	font-weight: 500;
	color: var(--eerp-brand);
	margin: 0 0 6px 0;
	line-height: 1.25;
}

.eerp-card-subtitle {
	font-size: 0.9375rem;
	color: var(--eerp-text-muted);
	margin: 0;
}

/* Flex utilities */
.eerp-flex-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

/* Form Styles */
.eerp-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.eerp-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

@media (max-width: 600px) {
	.eerp-grid-2 {
		grid-template-columns: 1fr;
	}
}

.eerp-form-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.eerp-label {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--eerp-neutral-700);
}

.eerp-field-label-bold {
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--eerp-neutral-900);
	margin: 0 0 10px 0;
}

.eerp-req {
	color: var(--eerp-status-absent);
	margin-left: 2px;
}

.eerp-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--eerp-neutral-300);
	border-radius: 8px;
	font-size: 0.9375rem;
	color: var(--eerp-neutral-900);
	background-color: var(--eerp-surface);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.eerp-input:focus {
	outline: none;
	border-color: var(--eerp-brand);
	box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.eerp-input.is-invalid {
	border-color: var(--eerp-status-absent);
	background-color: var(--eerp-status-absent-soft);
}

.eerp-input.is-valid {
	border-color: var(--eerp-status-present);
}

/* Password show/hide toggle */
.eerp-password-wrapper {
	position: relative;
}

.eerp-password-wrapper .eerp-input {
	padding-right: 42px;
}

.eerp-password-toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	padding: 6px;
	color: var(--eerp-text-muted);
	border-radius: 6px;
}

.eerp-password-toggle:hover {
	color: var(--eerp-text);
	background-color: var(--eerp-neutral-100);
}

.eerp-field-error {
	font-size: 0.8125rem;
	color: var(--eerp-status-absent);
	min-height: 18px;
}

.eerp-field-feedback {
	font-size: 0.8125rem;
	margin-top: 2px;
}

.eerp-feedback-success {
	color: var(--eerp-status-present-text);
}

.eerp-feedback-error {
	color: var(--eerp-status-absent);
}

.eerp-feedback-checking {
	color: var(--eerp-text-muted);
}

/* Role Selector Pills */
.eerp-role-pills {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 20px;
}

@media (max-width: 600px) {
	.eerp-role-pills {
		grid-template-columns: 1fr;
	}
}

.eerp-role-pill {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 14px 16px;
	border: 2px solid var(--eerp-border);
	border-radius: 10px;
	background: var(--eerp-surface);
	cursor: pointer;
	text-align: left;
	transition: all 0.15s ease;
}

.eerp-role-pill:hover {
	border-color: var(--eerp-neutral-300);
	background-color: var(--eerp-neutral-50);
}

.eerp-role-pill.active {
	border-color: var(--eerp-brand);
	background-color: var(--eerp-brand-soft);
	box-shadow: 0 0 0 1px var(--eerp-brand);
}

.eerp-role-pill-icon {
	font-size: 1.5rem;
	margin-bottom: 4px;
}

.eerp-role-pill-title {
	font-weight: 700;
	font-size: 0.9375rem;
	color: var(--eerp-neutral-900);
}

.eerp-role-pill-desc {
	font-size: 0.8125rem;
	color: var(--eerp-text-muted);
	margin-top: 2px;
}

/* Buttons */
.eerp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-weight: 600;
	font-size: 0.9375rem;
	padding: 10px 20px;
	border-radius: 8px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: all 0.15s ease;
	line-height: 1.3;
	white-space: nowrap;
}

/* Every state is set explicitly so the theme's own button hover and focus colours cannot override it. */
.eerp-btn.eerp-btn-primary,
.eerp-btn.eerp-btn-primary:hover,
.eerp-btn.eerp-btn-primary:focus,
.eerp-btn.eerp-btn-primary:active {
  color: var(--eerp-on-brand) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.eerp-btn.eerp-btn-primary {
  background-color: var(--eerp-brand) !important;
}
.eerp-btn.eerp-btn-primary:hover:not(:disabled),
.eerp-btn.eerp-btn-primary:focus:not(:disabled),
.eerp-btn.eerp-btn-primary:active:not(:disabled) {
  background-color: var(--eerp-brand-hover) !important;
}

.eerp-btn.eerp-btn-success,
.eerp-btn.eerp-btn-success:hover,
.eerp-btn.eerp-btn-success:focus,
.eerp-btn.eerp-btn-success:active {
  color: var(--eerp-surface) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.eerp-btn.eerp-btn-success {
  background-color: var(--eerp-status-present) !important;
}
.eerp-btn.eerp-btn-success:hover:not(:disabled),
.eerp-btn.eerp-btn-success:focus:not(:disabled),
.eerp-btn.eerp-btn-success:active:not(:disabled) {
  background-color: var(--eerp-status-present-text) !important;
}

.eerp-btn.eerp-btn-danger,
.eerp-btn.eerp-btn-danger:hover,
.eerp-btn.eerp-btn-danger:focus,
.eerp-btn.eerp-btn-danger:active {
  color: var(--eerp-surface) !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.eerp-btn.eerp-btn-danger {
  background-color: var(--eerp-status-absent) !important;
}
.eerp-btn.eerp-btn-danger:hover:not(:disabled),
.eerp-btn.eerp-btn-danger:focus:not(:disabled),
.eerp-btn.eerp-btn-danger:active:not(:disabled) {
  background-color: var(--eerp-status-absent-text) !important;
}

.eerp-btn:focus-visible {
  outline: 2px solid var(--eerp-brand);
  outline-offset: 2px;
}

.eerp-btn-sm {
	padding: 6px 12px;
	font-size: 0.8125rem;
	border-radius: 6px;
}

.eerp-btn-full {
	width: 100%;
}

.eerp-btn-group {
	display: inline-flex;
	gap: 6px;
}

.eerp-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: var(--eerp-on-brand);
	animation: eerp-spin 0.6s linear infinite;
}

@keyframes eerp-spin {
	to { transform: rotate(360deg); }
}

/* Badges */
.eerp-badge {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 9999px;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.eerp-badge-warning {
	background-color: var(--eerp-status-late-soft);
	color: var(--eerp-status-late-text);
}

.eerp-badge-success {
	background-color: var(--eerp-status-present-soft);
	color: var(--eerp-status-present-text);
}

/* Tables */
.eerp-table-responsive {
	overflow-x: auto;
	margin-top: 12px;
}

.eerp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	text-align: left;
}

.eerp-table th {
	background-color: var(--eerp-neutral-50);
	color: var(--eerp-neutral-600);
	font-weight: 600;
	padding: 10px 14px;
	border-bottom: 2px solid var(--eerp-border);
}

.eerp-table td {
	padding: 12px 14px;
	border-bottom: 1px solid var(--eerp-neutral-100);
	color: var(--eerp-neutral-700);
	vertical-align: middle;
}

.eerp-table tr:hover td {
	background-color: var(--eerp-neutral-50);
}

.eerp-text-right {
	text-align: right;
}

.eerp-text-center {
	text-align: center;
}

.eerp-font-medium {
	font-weight: 600;
	color: var(--eerp-neutral-900);
}

.eerp-empty-row td {
	padding: 40px 16px;
}

.eerp-empty-text {
	color: var(--eerp-text-muted);
	font-size: 0.9375rem;
	margin: 0;
}

/* Notices & Alerts */
.eerp-portal-notice {
	padding: 14px 18px;
	border-radius: 8px;
	font-size: 0.9375rem;
	margin: 16px 0;
	border-left: 4px solid;
}

.eerp-portal-notice-info {
	background-color: var(--eerp-brand-soft);
	border-color: var(--eerp-brand);
	color: var(--eerp-brand);
}

.eerp-portal-notice-warning {
	background-color: var(--eerp-status-late-soft);
	border-color: var(--eerp-status-late);
	color: var(--eerp-status-late-text);
}

.eerp-form-alert {
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 0.875rem;
}

.eerp-alert-error {
	background-color: var(--eerp-status-absent-soft);
	color: var(--eerp-status-absent-text);
	border: 1px solid var(--eerp-border);
}

.eerp-alert-success {
	background-color: var(--eerp-status-present-soft);
	color: var(--eerp-status-present-text);
	border: 1px solid var(--eerp-border);
}

/* Success Panel */
.eerp-success-panel {
	text-align: center;
	padding: 36px 20px;
}

.eerp-success-icon {
	width: 56px;
	height: 56px;
	background-color: var(--eerp-status-present);
	color: var(--eerp-surface);
	font-size: 28px;
	font-weight: bold;
	line-height: 56px;
	border-radius: 50%;
	margin: 0 auto 16px auto;
}

.eerp-success-title {
	font-size: 1.375rem;
	font-weight: 700;
	color: var(--eerp-neutral-900);
	margin: 0 0 8px 0;
}

.eerp-success-text {
	font-size: 0.9375rem;
	color: var(--eerp-neutral-600);
	max-width: 500px;
	margin: 0 auto;
	line-height: 1.6;
}

/* Links */
.eerp-sublink {
	font-size: 0.8125rem;
	color: var(--eerp-brand);
	text-decoration: none;
}

.eerp-sublink:hover {
	text-decoration: underline;
}

.eerp-checkbox-group {
	margin-top: 4px;
}

.eerp-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.875rem;
	color: var(--eerp-neutral-600);
	cursor: pointer;
}
