/**
 * TripThis Password Reset — frontend styles.
 *
 * Same visual language as TripThis Login and the other TripThis plugins:
 * soft #f7f9fb field fills, 1.5px #e7ebf0 borders, a 16px radius, a teal
 * #2ab5b5 accent / focus ring, muted helper text, pill buttons and a soft
 * card shadow.
 */

.ttpr {
	--ttpr-accent: #2ab5b5;
	--ttpr-accent-dark: #1a8a8a;
	--ttpr-border: #e7ebf0;
	--ttpr-line-strong: #d5dce4;
	--ttpr-field: #f7f9fb;
	--ttpr-text: #12212e;
	--ttpr-ink-soft: #40515f;
	--ttpr-muted: #7b8896;
	--ttpr-error: #c0392b;
	--ttpr-success: #1f9d6b;
	--ttpr-ring: rgba(42, 181, 181, 0.32);
	--ttpr-radius: 16px;
	--ttpr-radius-sm: 11px;
	--ttpr-shadow: 0 1px 2px rgba(18, 33, 46, 0.04), 0 12px 30px -18px rgba(18, 33, 46, 0.25);

	box-sizing: border-box;
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	color: var(--ttpr-text);
	font-size: 15px;
	line-height: 1.5;
	font-family: var(--e-global-typography-primary-font-family, "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	font-weight: 500;
}

.ttpr *,
.ttpr *::before,
.ttpr *::after {
	box-sizing: border-box;
}

.ttpr [hidden] {
	display: none !important;
}

.ttpr-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Card ---- */

.ttpr-card {
	border: 1px solid var(--ttpr-border);
	border-radius: var(--ttpr-radius);
	box-shadow: var(--ttpr-shadow);
	padding: 28px;
}

.ttpr-view {
	margin: 0;
}

.ttpr-title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 600;
	color: var(--ttpr-text);
}

.ttpr-title:focus {
	outline: none;
}

.ttpr-hint {
	margin: 0 0 20px;
	font-size: 0.9rem;
	color: var(--ttpr-muted);
}

.ttpr-hint strong {
	color: var(--ttpr-ink-soft);
}

/* ---- Fields ---- */

.ttpr-field {
	display: block;
	margin-bottom: 16px;
}

.ttpr .ttpr-field__label {
	display: block;
	font-weight: 600;
	font-size: 0.88rem;
	margin-bottom: 7px;
	color: var(--ttpr-ink-soft);
}

/* Specificity raised past the theme's global input rules. */
.ttpr .ttpr-input {
	display: block;
	width: 100%;
	min-height: 48px;
	margin: 0;
	padding: 12px 14px;
	font: inherit;
	font-size: 0.95rem;
	color: var(--ttpr-text);
	background: var(--ttpr-field);
	border: 1.5px solid var(--ttpr-border);
	border-radius: var(--ttpr-radius);
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ttpr .ttpr-input::placeholder {
	color: var(--ttpr-muted);
	opacity: 0.8;
}

.ttpr .ttpr-input:hover {
	border-color: var(--ttpr-line-strong);
}

.ttpr .ttpr-input:focus {
	outline: none;
	border-color: var(--ttpr-accent);
	background: #fff;
	box-shadow: 0 0 0 4px var(--ttpr-ring);
}

/* Password with the eye toggle sitting inside the input. */
.ttpr-pw {
	position: relative;
}

.ttpr .ttpr-pw .ttpr-input {
	padding-right: 52px;
}

.ttpr-eye {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: var(--ttpr-accent);
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: color 0.15s ease, background 0.15s ease;
}

.ttpr-eye:hover {
	color: var(--ttpr-accent-dark);
	background: rgba(42, 181, 181, 0.08);
}

.ttpr-eye:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--ttpr-ring);
}

.ttpr-eye svg {
	display: block;
}

/* Length rule under the new password; turns green once met. */
.ttpr-rule {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-top: 8px;
	font-size: 0.82rem;
	color: var(--ttpr-muted);
	transition: color 0.15s ease;
}

.ttpr-rule::before {
	content: "";
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ttpr-line-strong);
	transition: background 0.15s ease;
}

.ttpr-rule.is-met {
	color: var(--ttpr-success);
}

.ttpr-rule.is-met::before {
	background: var(--ttpr-success);
}

.ttpr .ttpr-link {
	color: var(--ttpr-accent);
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.15s ease;
}

.ttpr .ttpr-link:hover,
.ttpr .ttpr-link:focus-visible {
	color: var(--ttpr-accent-dark);
}

/* ---- Buttons ----
   Real <button>s and links, so every property the theme's global button
   rules touch is set explicitly here. */

.ttpr .ttpr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	margin: 6px 0 0;
	padding: 11px 22px;
	border: 1px solid var(--ttpr-border);
	border-radius: 999px;
	background: #fff;
	color: var(--ttpr-text);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ttpr .ttpr-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px var(--ttpr-ring);
}

.ttpr .ttpr-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.ttpr .ttpr-btn--primary {
	background: var(--ttpr-accent);
	border-color: var(--ttpr-accent);
	color: #fff;
	box-shadow: var(--ttpr-shadow);
}

.ttpr .ttpr-btn--primary:hover:not(:disabled),
.ttpr .ttpr-btn--primary:focus:not(:disabled) {
	background: var(--ttpr-accent-dark);
	border-color: var(--ttpr-accent-dark);
	color: #fff;
}

.ttpr .ttpr-btn--block {
	width: 100%;
	min-height: 50px;
}

/* Busy spinner, shown inside the button while a request is in flight. */
.ttpr-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ttpr-spin 0.7s linear infinite;
}

.ttpr-btn.is-busy .ttpr-spinner {
	display: inline-block;
}

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

/* ---- Alerts ---- */

.ttpr-alert {
	margin: 0 0 16px;
	padding: 11px 16px;
	border-radius: var(--ttpr-radius-sm);
	font-size: 14px;
	font-weight: 600;
}

.ttpr-alert--error {
	background: #fef5f5;
	border: 1px solid color-mix(in srgb, var(--ttpr-error) 40%, var(--ttpr-border));
	color: color-mix(in srgb, var(--ttpr-error) 78%, #000);
}

/* ---- Status views (sent / invalid / done) ---- */

.ttpr-back {
	margin-top: 18px;
	text-align: center;
}

.ttpr-status {
	text-align: center;
}

.ttpr-status__icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #e9f7f7;
	color: var(--ttpr-accent);
}

.ttpr-status__icon--error {
	background: #fef5f5;
	color: var(--ttpr-error);
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
	.ttpr-card {
		padding: 20px;
	}
}

/* ---- Reduced motion ---- */

@media (prefers-reduced-motion: reduce) {
	.ttpr .ttpr-input,
	.ttpr .ttpr-btn,
	.ttpr-eye,
	.ttpr-rule,
	.ttpr-rule::before {
		transition: none;
	}

	.ttpr-spinner {
		animation-duration: 1.5s;
	}
}
