/**
 * EARA Resident Manager – Public Shared Styles
 * Premium redesign — matches survey tool and field app design language.
 * Applies to [eara_update_form], [eara_field_app], and shared components.
 */

/* ── Reset ────────────────────────────────────────────────────────────────── */

.eara-form-wrap *,
.eara-field-app *,
.eara-survey *,
.eara-dashboard * {
	box-sizing: border-box;
}

/* ── Notices ──────────────────────────────────────────────────────────────── */

.eara-notice {
	padding: 14px 18px;
	border-radius: 10px;
	margin-bottom: 20px;
	font-size: 14px;
	line-height: 1.55;
}

.eara-notice--success {
	background: #f0fdf4;
	border: 1.5px solid #86efac;
	color: #065f46;
}

.eara-notice--error {
	background: #fff5f5;
	border: 1.5px solid #fca5a5;
	color: #991b1b;
}

.eara-notice--warning {
	background: #fffbeb;
	border: 1.5px solid #fde68a;
	color: #713f12;
}

/* ── Update form wrapper ──────────────────────────────────────────────────── */

.eara-form-wrap {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	max-width: 640px;
	margin: 0 auto;
}

/* ── Form header banner ───────────────────────────────────────────────────── */

.eara-form-header {
	background: linear-gradient(135deg, #0f2444 0%, #1e3a5f 50%, #1d4ed8 100%);
	border-radius: 16px;
	padding: 24px 20px;
	margin-bottom: 20px;
	color: #fff;
	display: flex;
	align-items: center;
	gap: 16px;
}

.eara-form-header__icon {
	font-size: 40px;
	flex-shrink: 0;
}

.eara-form-header__title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 4px;
	color: #fff;
}

.eara-form-header__subtitle {
	font-size: 13px;
	color: #93c5fd;
	margin: 0;
	line-height: 1.5;
}

/* ── Form card ────────────────────────────────────────────────────────────── */

.eara-form-card {
	background: #fff;
	border: 2px solid #e2e8f0;
	border-radius: 14px;
	padding: 24px;
	box-shadow: 0 2px 8px rgba(0,0,0,.04);
	margin-bottom: 16px;
}

.eara-form-card__title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 14px;
	font-weight: 700;
	color: #1e3a5f;
	margin: 0 0 18px;
	padding-bottom: 12px;
	border-bottom: 1px solid #f1f5f9;
}

.eara-form-card__title-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	background: #2563eb;
	color: #fff;
	border-radius: 50%;
	font-size: 12px;
	font-weight: 700;
	flex-shrink: 0;
}

/* ── Form layout ──────────────────────────────────────────────────────────── */

.eara-form,
.eara-inline-form {
	max-width: 100%;
}

.eara-field {
	margin-bottom: 18px;
}

.eara-field-row {
	display: flex;
	gap: 14px;
	margin-bottom: 0;
}

.eara-field-row .eara-field {
	flex: 1 1 auto;
}

.eara-field--sm   { flex: 0 0 110px; }
.eara-field--lg   { flex: 1 1 auto; }
.eara-field--half { max-width: 200px; }

/* ── Labels ───────────────────────────────────────────────────────────────── */

.eara-label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 13px;
	color: #374151;
	letter-spacing: .01em;
}

.eara-required {
	color: #dc2626;
	margin-left: 2px;
}

/* ── Inputs ───────────────────────────────────────────────────────────────── */

.eara-input {
	display: block;
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	font-size: 15px;
	line-height: 1.4;
	color: #1e293b;
	background: #f8fafc;
	transition: border-color .15s, box-shadow .15s, background .15s;
	appearance: auto;
	font-family: inherit;
}

.eara-input:focus {
	outline: none;
	border-color: #2563eb;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.eara-input:hover:not(:focus) {
	border-color: #cbd5e1;
	background: #fff;
}

.eara-input--error {
	border-color: #ef4444;
	background: #fff5f5;
	box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

textarea.eara-input {
	resize: vertical;
	min-height: 80px;
}

/* ── Consent section ──────────────────────────────────────────────────────── */

.eara-consent-section {
	background: #f0f9ff;
	border: 1.5px solid #bae6fd;
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 18px;
}

.eara-consent-section__title {
	font-size: 13px;
	font-weight: 700;
	color: #0369a1;
	margin: 0 0 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.eara-field--checkbox {
	margin-bottom: 12px;
}

.eara-field--checkbox:last-child {
	margin-bottom: 0;
}

.eara-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13px;
	line-height: 1.55;
	cursor: pointer;
	color: #374151;
}

.eara-checkbox-label input[type="checkbox"] {
	flex-shrink: 0;
	margin-top: 2px;
	width: 17px;
	height: 17px;
	accent-color: #2563eb;
	cursor: pointer;
}

/* ── GDPR note ────────────────────────────────────────────────────────────── */

.eara-gdpr-note {
	font-size: 12px;
	color: #94a3b8;
	line-height: 1.55;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #e2e8f0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.eara-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: 2px solid transparent;
	line-height: 1.3;
	transition: all .15s;
	text-decoration: none;
	font-family: inherit;
}

.eara-btn:disabled {
	opacity: .55;
	cursor: not-allowed;
	transform: none !important;
}

.eara-btn--primary {
	background: linear-gradient(135deg, #1e3a5f, #2563eb);
	color: #fff !important;
	border-color: transparent;
}

.eara-btn--primary:hover:not(:disabled) {
	opacity: .9;
	transform: translateY(-1px);
}

.eara-btn--secondary {
	background: #f1f5f9;
	color: #1e293b;
	border-color: #e2e8f0;
}

.eara-btn--secondary:hover:not(:disabled) {
	background: #e2e8f0;
}

.eara-btn--ghost {
	background: transparent;
	color: #64748b;
	border-color: #e2e8f0;
}

.eara-btn--ghost:hover:not(:disabled) {
	background: #f8fafc;
}

.eara-btn--sm {
	padding: 7px 14px;
	font-size: 12px;
}

/* ── Form footer ──────────────────────────────────────────────────────────── */

.eara-form-footer {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 24px;
	flex-wrap: wrap;
}

/* ── Submit CTA area ──────────────────────────────────────────────────────── */

.eara-form-submit-area {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 20px;
	text-align: center;
	margin-top: 8px;
}

.eara-form-submit-area .eara-btn--primary {
	min-width: 200px;
	justify-content: center;
	padding: 14px 32px;
	font-size: 15px;
	color: #fff !important;
}

.eara-form-submit-hint {
	font-size: 12px;
	color: #94a3b8;
	margin-top: 10px;
}

/* ── Form messages ────────────────────────────────────────────────────────── */

.eara-form-messages {
	margin-bottom: 16px;
}

.eara-form-intro {
	font-size: 14px;
	color: #475569;
	margin-bottom: 20px;
	line-height: 1.6;
}

/* ── Loading / Spinner ────────────────────────────────────────────────────── */

.eara-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px;
	color: #64748b;
	font-size: 14px;
}

.eara-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid #e2e8f0;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: eara-spin .7s linear infinite;
	flex-shrink: 0;
}

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

/* ── Success state ────────────────────────────────────────────────────────── */

.eara-form-success {
	text-align: center;
	padding: 40px 24px;
	background: #f0fdf4;
	border: 2px solid #86efac;
	border-radius: 16px;
}

.eara-form-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	background: #16a34a;
	color: #fff;
	border-radius: 50%;
	font-size: 30px;
	margin-bottom: 16px;
}

.eara-form-success h3 {
	font-size: 20px;
	color: #065f46;
	margin: 0 0 8px;
}

.eara-form-success p {
	font-size: 14px;
	color: #374151;
	margin: 0;
}

/* ── Inline form messages ─────────────────────────────────────────────────── */

.eara-inline-msg { font-size: 13px; margin-left: 4px; }
.eara-inline-msg--error   { color: #b91c1c; }
.eara-inline-msg--success { color: #15803d; }

/* ── Connection status dot ────────────────────────────────────────────────── */

.eara-header-right {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.eara-conn-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-radius: 20px;
	padding: 5px 12px 5px 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .01em;
	border: 1.5px solid transparent;
	transition: background .3s, border-color .3s;
	white-space: nowrap;
}

.eara-conn-status__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
	transition: background .3s, box-shadow .3s;
}

/* ── Online — green ── */
.eara-conn-status--online {
	background: rgba(22,163,74,.18);
	border-color: rgba(22,163,74,.35);
	color: #bbf7d0;
}
.eara-conn-status--online .eara-conn-status__dot {
	background: #4ade80;
	box-shadow: 0 0 0 3px rgba(74,222,128,.3);
}

/* ── Offline — red ── */
.eara-conn-status--offline {
	background: rgba(185,28,28,.18);
	border-color: rgba(185,28,28,.35);
	color: #fecaca;
}
.eara-conn-status--offline .eara-conn-status__dot {
	background: #f87171;
	box-shadow: 0 0 0 3px rgba(248,113,113,.3);
}

/* ── Syncing — amber ── */
.eara-conn-status--syncing {
	background: rgba(217,119,6,.18);
	border-color: rgba(217,119,6,.35);
	color: #fde68a;
}
.eara-conn-status--syncing .eara-conn-status__dot {
	background: #fbbf24;
	box-shadow: 0 0 0 3px rgba(251,191,36,.3);
	animation: eara-pulse 1.2s ease-in-out infinite;
}

@keyframes eara-pulse {
	0%, 100% { box-shadow: 0 0 0 3px rgba(251,191,36,.3); }
	50%       { box-shadow: 0 0 0 6px rgba(251,191,36,.0); }
}

/* ── Offline / SW banner ──────────────────────────────────────────────────── */

.eara-sw-banner {
	display: none;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 8px;
	margin-bottom: 16px;
	position: sticky;
	top: 0;
	z-index: 999;
}

.eara-sw-banner--offline {
	background: #fffbeb;
	border: 1px solid #fcd34d;
	color: #92400e;
}

.eara-sw-banner--success {
	background: #f0fdf4;
	border: 1px solid #86efac;
	color: #065f46;
}

.eara-sw-banner--warning {
	background: #fff5f5;
	border: 1px solid #fca5a5;
	color: #991b1b;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
	.eara-form-header { padding: 18px 16px; gap: 12px; }
	.eara-form-header__title { font-size: 17px; }
	.eara-form-card { padding: 18px 16px; }
	.eara-field-row { flex-direction: column; gap: 0; }
	.eara-field--sm, .eara-field--half { max-width: 100%; flex-basis: auto; }
	.eara-form-submit-area .eara-btn--primary { width: 100%; }
}

/* ── Password Reset Forms ─────────────────────────────────────────────────── */

.eara-pw-form-wrap {
	display: flex;
	justify-content: center;
	padding: 40px 16px;
	min-height: 60vh;
	align-items: flex-start;
}

.eara-pw-card {
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 4px 24px rgba(0,0,0,.10);
	padding: 40px 36px;
	width: 100%;
	max-width: 440px;
	text-align: center;
}

.eara-pw-card__icon {
	font-size: 48px;
	margin-bottom: 12px;
}

.eara-pw-card__title {
	font-size: 22px;
	font-weight: 800;
	color: #0f2444;
	margin: 0 0 8px;
}

.eara-pw-card__subtitle {
	font-size: 14px;
	color: #64748b;
	margin: 0 0 24px;
	line-height: 1.5;
}

.eara-pw-field {
	text-align: left;
	margin-bottom: 16px;
}

.eara-pw-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
	margin-bottom: 5px;
}

.eara-pw-input {
	width: 100%;
	padding: 10px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	font-size: 15px;
	outline: none;
	box-sizing: border-box;
	transition: border-color .15s;
}

.eara-pw-input:focus {
	border-color: #2563eb;
}

.eara-pw-btn {
	width: 100%;
	padding: 12px;
	background: linear-gradient(135deg, #0f2444, #2563eb);
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 8px;
	transition: opacity .15s;
}

.eara-pw-btn:disabled {
	opacity: .6;
	cursor: not-allowed;
}

.eara-pw-msg {
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 14px;
	text-align: left;
	margin-bottom: 16px;
	line-height: 1.5;
}

.eara-pw-msg--success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #6ee7b7;
}

.eara-pw-msg--error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

.eara-pw-back-link {
	margin-top: 20px;
	font-size: 13px;
	color: #64748b;
}

.eara-pw-back-link a {
	color: #2563eb;
	text-decoration: none;
}

.eara-pw-back-link a:hover {
	text-decoration: underline;
}

@media ( max-width: 480px ) {
	.eara-pw-card { padding: 28px 20px; }
}

/* ── FAQ Accordion — modern card style ──────────────────────────────────── */

.eara-faq {
	max-width: 820px;
	margin: 56px auto 0;
	padding: 0;
}

.eara-faq__title {
	font-size: 28px !important;
	font-weight: 700 !important;
	color: #0f2444 !important;
	text-align: center;
	margin: 0 0 14px !important;
}

.eara-faq__intro {
	font-size: 15px;
	color: #64748b;
	margin: 0 0 36px;
	line-height: 1.7;
	text-align: center;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
}

/* Each item is its own white card with gap between */
.eara-faq__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	border: none;
	border-radius: 0;
	overflow: visible;
}

.eara-faq__item {
	border: 1.5px solid #e2e8f0 !important;
	border-radius: 12px !important;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,.04);
	transition: box-shadow .15s;
}

.eara-faq__item:last-child {
	border-bottom: 1.5px solid #e2e8f0 !important;
}

.eara-faq__item:has([aria-expanded="true"]) {
	box-shadow: 0 4px 16px rgba(29,78,216,.10);
	border-color: #bfdbfe !important;
}

/* The button row */
.eara-faq__question {
	width: 100% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 20px !important;
	padding: 20px 24px !important;
	background: #fff !important;
	border: none !important;
	border-radius: 0 !important;
	cursor: pointer !important;
	text-align: left !important;
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	color: #1e3a5f !important;
	transition: background .15s !important;
	line-height: 1.4 !important;
	outline: none;
	box-shadow: none !important;
}

.eara-faq__question:hover {
	background: #f8fafc !important;
}

.eara-faq__question:focus-visible {
	outline: 2px solid #3b82f6;
	outline-offset: -2px;
}

.eara-faq__question[aria-expanded="true"] {
	background: #fff !important;
	color: #1d4ed8 !important;
	border-bottom: 1px solid #e2e8f0 !important;
}

.eara-faq__question-text {
	flex: 1;
}

/* The +/− icon — right-aligned, clean */
.eara-faq__icon {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid #cbd5e1;
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 300;
	color: #64748b !important;
	line-height: 1;
	transition: border-color .2s, background .2s, color .2s, transform .3s;
}

.eara-faq__question[aria-expanded="true"] .eara-faq__icon {
	background: #1d4ed8 !important;
	border-color: #1d4ed8 !important;
	color: #fff !important;
	transform: rotate(45deg);
}

/* Answer panel */
.eara-faq__answer {
	padding: 0 24px 22px 24px;
	background: #fff;
	animation: eara-faq-open .18s ease-out;
}

.eara-faq__answer p {
	margin: 14px 0 0 !important;
	font-size: 15px !important;
	color: #374151 !important;
	line-height: 1.8 !important;
}

@keyframes eara-faq-open {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

.eara-faq__footer {
	margin: 28px 0 0;
	font-size: 14px;
	color: #64748b;
	text-align: center;
}

.eara-faq__footer a {
	color: #1d4ed8 !important;
	text-decoration: none;
	font-weight: 600;
}

.eara-faq__footer a:hover {
	text-decoration: underline;
}
