/* =========================================================================
   THEORYS — Account gate modal
   Site-wide (loads on shop/product pages too), so it is self-sufficient:
   it relies only on the brand tokens defined in style.css :root.
   Scoped under .thr-auth / .thr-modal so nothing leaks into Storefront.
   ========================================================================= */

/* Backdrop --------------------------------------------------------------- */
.thr-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(14, 18, 15, 0.55);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .18s ease, visibility .18s ease;
}
.thr-modal.is-open { opacity: 1; visibility: visible; }
body.thr-modal-open { overflow: hidden; }

/* Card ------------------------------------------------------------------- */
.thr-modal-card {
	position: relative;
	width: 100%;
	max-width: 440px;
	background: var(--white);
	border-radius: 20px;
	padding: 34px 30px 30px;
	box-shadow: 0 30px 80px rgba(14, 18, 15, 0.35);
	border: 1px solid var(--line);
	font-family: var(--font-body);
	color: var(--ink);
	transform: translateY(8px) scale(.99);
	transition: transform .2s ease;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
}
.thr-modal.is-open .thr-modal-card { transform: none; }

/* Metallic top hairline */
.thr-modal-card::before {
	content: "";
	position: absolute;
	top: 0; left: 24px; right: 24px;
	height: 2px;
	background: var(--metal);
	border-radius: 0 0 2px 2px;
}

.thr-modal-close {
	position: absolute;
	top: 14px; right: 14px;
	width: 36px; height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--white);
	color: var(--ink);
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	transition: border-color .15s ease, color .15s ease;
}
.thr-modal-close:hover { border-color: var(--forest-mid); color: var(--forest-mid); }

.thr-modal-eyebrow {
	font-family: var(--font-head);
	font-size: 11px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--forest-mid);
	margin: 0 0 8px;
	font-weight: 600;
}
.thr-modal-title {
	font-family: var(--font-head);
	font-size: 25px;
	letter-spacing: -0.02em;
	margin: 0 0 6px;
	color: var(--ink);
	font-weight: 600;
}
.thr-modal-desc { font-size: 14px; color: #3a423d; margin: 0 0 22px; }

/* Panels (sign-in vs create) — toggled via [hidden] ---------------------- */
.thr-auth-panel[hidden] { display: none; }

/* Fields ----------------------------------------------------------------- */
.thr-field { margin-bottom: 15px; }
.thr-field label {
	display: block;
	font-family: var(--font-head);
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: 0.02em;
	margin-bottom: 6px;
	color: var(--ink);
}
.thr-field input[type="email"],
.thr-field input[type="password"] {
	width: 100%;
	font-family: var(--font-body);
	font-size: 15px;
	color: var(--ink);
	background: var(--off-white);
	border: 1.5px solid var(--line);
	border-radius: 11px;
	padding: 12px 14px;
	transition: border-color .15s ease, background .15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.thr-field input:focus {
	outline: none;
	border-color: var(--forest-mid);
	background: var(--white);
}

/* Terms checkbox --------------------------------------------------------- */
.thr-terms {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	margin: 6px 0 20px;
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--off-white);
}
.thr-terms input[type="checkbox"] {
	flex: none;
	width: 18px; height: 18px;
	margin-top: 2px;
	accent-color: var(--forest-deep);
	cursor: pointer;
}
.thr-terms label { font-size: 12.5px; line-height: 1.5; color: #3a423d; cursor: pointer; }
.thr-terms a { color: var(--forest-mid); text-decoration: underline; }

/* Buttons (self-contained; does not depend on the lander stylesheet) ----- */
.thr-modal .thr-submit {
	width: 100%;
	font-family: var(--font-head);
	font-weight: 500;
	font-size: 15px;
	padding: 13px 20px;
	border-radius: 12px;
	border: 1.5px solid var(--forest-deep);
	background: var(--forest-deep);
	color: var(--white);
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease;
}
.thr-modal .thr-submit:hover:not(:disabled) { background: var(--forest-mid); border-color: var(--forest-mid); }
.thr-modal .thr-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.thr-submit-row { margin-top: 4px; }

.thr-auth-alt {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	flex-wrap: wrap;
}
.thr-link {
	background: none;
	border: 0;
	padding: 0;
	font-family: var(--font-body);
	font-size: 13.5px;
	color: var(--forest-mid);
	cursor: pointer;
	text-decoration: underline;
}
.thr-link:hover { color: var(--forest-deep); }

/* Feedback --------------------------------------------------------------- */
.thr-auth-msg {
	font-size: 13.5px;
	line-height: 1.5;
	border-radius: 10px;
	padding: 11px 13px;
	margin-bottom: 16px;
}
.thr-auth-msg[hidden] { display: none; }
.thr-auth-msg--error { background: #fbeaea; color: #8a1f1f; border: 1px solid #f0cccc; }
.thr-auth-msg--ok    { background: #e8f3ee; color: #1B3A2F; border: 1px solid #bfe0d1; }

.thr-spin { opacity: 0.6; pointer-events: none; }

/* Guest price-lock link (in shop/product pages) -------------------------- */
.thr-price-locked {
	display: inline-block;
	font-family: var(--font-head);
	font-weight: 500;
	color: var(--forest-mid);
	cursor: pointer;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}
.thr-price-locked:hover { color: var(--forest-deep); }
a.button.thr-open-auth { /* keep the WC add-to-cart replacement on-brand */
	background: var(--forest-deep);
	color: var(--white);
}
a.button.thr-open-auth:hover { background: var(--forest-mid); color: var(--white); }
