/**
 * Provatic Members — front-end styles.
 *
 * Scoped under .provatic-members-form / .provatic-members-mypage so we don't
 * leak into theme styles. Uses CSS custom properties so themes can override
 * (--provatic-brand, --provatic-radius, etc.).
 */

.provatic-members-form,
.provatic-members-mypage,
.provatic-members-login-card {
	--provatic-brand: #497ae8;
	--provatic-brand-dark: #3a63ba;
	--provatic-text: #1a202c;
	--provatic-text-muted: #6b7280;
	--provatic-border: #e2e4e9;
	--provatic-bg-subtle: #f7f8fa;
	--provatic-error: #c0392b;
	--provatic-success: #1e8e3e;
	--provatic-radius: 8px;

	max-width: 420px;
	margin: 0 auto;
	padding: 24px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--provatic-text);
}

.provatic-members-mypage {
	max-width: 880px;
}

/* ─────────────────────────────────────────────────────────────
 * Login form COMPONENT.
 *
 * One canonical style block. Whatever the operator sees in the
 * Settings preview is exactly what renders on the [provatic_login]
 * page AND inside the header Login Button modal — no surface-specific
 * modifier classes, no context branches. Settings overrides arrive as
 * inline <style> emitted by Login_Form_Renderer::build_inline_css().
 * ───────────────────────────────────────────────────────────── */
.provatic-members-login-card {
	background: #fff;
	border-radius: 12px;
	padding: 32px 28px 28px;
	width: 380px;
	max-width: 92vw;
	margin: 0 auto;
	box-sizing: border-box;
	box-shadow:
		0 8px 24px rgba(15, 23, 42, 0.10),
		0 2px 6px rgba(15, 23, 42, 0.04);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* The card already provides padding/max-width — neutralize the form's own
   layout properties when it's living inside one so they don't double-up. */
.provatic-members-login-card .provatic-members-form {
	max-width: none;
	margin: 0;
	padding: 0;
}

.provatic-members-login-card .provatic-members-form-title {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	color: #111827;
	text-align: center;
	letter-spacing: -0.01em;
}

.provatic-members-login-card .provatic-members-form-subtitle {
	margin: 0 0 22px;
	color: #6b7280;
	font-size: 13px;
	text-align: center;
	line-height: 1.5;
}

/* Form fields */
.provatic-members-form-field {
	margin-bottom: 16px;
}

.provatic-members-form-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 500;
	color: var(--provatic-text);
}

.provatic-members-form-field label .required {
	color: var(--provatic-error);
}

.provatic-members-form-field input[type="text"],
.provatic-members-form-field input[type="email"],
.provatic-members-form-field input[type="password"] {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid var(--provatic-border);
	border-radius: var(--provatic-radius);
	font-size: 14px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	background: #fff;
}

.provatic-members-form-field input:focus {
	outline: none;
	border-color: var(--provatic-brand);
	box-shadow: 0 0 0 3px rgba(73, 122, 232, 0.15);
}

/* Form row (remember + forgot password) */
.provatic-members-form-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: -4px 0 16px;
	font-size: 13px;
}

.provatic-members-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--provatic-text-muted);
}

.provatic-members-link {
	color: var(--provatic-brand);
	text-decoration: none;
}

.provatic-members-link:hover {
	text-decoration: underline;
}

/* Buttons */
.provatic-members-btn {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 12px 16px;
	border: none;
	border-radius: var(--provatic-radius);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
	text-align: center;
}

.provatic-members-btn-primary {
	background: var(--provatic-brand);
	color: #fff;
}

.provatic-members-btn-primary:hover:not(:disabled) {
	background: var(--provatic-brand-dark);
}

.provatic-members-btn-primary:disabled {
	background: var(--provatic-text-muted);
	cursor: not-allowed;
}

.provatic-members-btn-google {
	margin-top: 12px;
	background: #fff;
	color: var(--provatic-text);
	border: 1px solid var(--provatic-border);
	/* Inline-flex so the real Google SVG (rendered inside the button by
	   templates/login-form.php) sits cleanly next to the label. The fake
	   `::before { content: "G" }` placeholder that used to sit on the left
	   has been removed — the SVG provides the brand cue, the letter was
	   visual duplication. */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.provatic-members-btn-google:hover:not(:disabled) {
	background: var(--provatic-bg-subtle);
}

/* Divider */
.provatic-members-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0;
	color: var(--provatic-text-muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.provatic-members-divider::before,
.provatic-members-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--provatic-border);
}

/* Form intro / footer text */
.provatic-members-form-intro {
	margin-top: 0;
	margin-bottom: 20px;
	color: var(--provatic-text-muted);
}

.provatic-members-footer-link {
	margin-top: 20px;
	text-align: center;
	color: var(--provatic-text-muted);
	font-size: 13px;
}

.provatic-members-footer-link a {
	color: var(--provatic-brand);
	text-decoration: none;
}

/* Feedback messages */
.provatic-members-form-feedback {
	margin-top: 12px;
	padding: 0 12px;
	font-size: 13px;
	min-height: 1.2em;
}

.provatic-members-form-feedback.is-error {
	color: var(--provatic-error);
}

.provatic-members-form-feedback.is-success {
	color: var(--provatic-success);
}

/* Inline notice shown above the login/signup forms — typically by the
   email-verification callback returning ?provatic_verify_result=verified|expired|invalid. */
.provatic-members-notice {
	padding: 12px 16px;
	border-radius: var(--provatic-radius);
	margin-bottom: 16px;
	font-size: 14px;
}

.provatic-members-notice--success {
	background: #dcfce7;
	color: #15803d;
	border: 1px solid #86efac;
}

.provatic-members-notice--error {
	background: #fee2e2;
	color: #b91c1c;
	border: 1px solid #fca5a5;
}

.provatic-members-info {
	padding: 16px;
	background: var(--provatic-bg-subtle);
	border-radius: var(--provatic-radius);
	text-align: center;
	color: var(--provatic-text-muted);
}

/* ---- MyPage ---- */

.provatic-members-mypage-header h2 {
	margin: 0 0 24px;
	font-size: 24px;
	font-weight: 600;
	color: var(--provatic-text);
}

.provatic-members-mypage-tabs {
	display: flex;
	gap: 2px;
	border-bottom: 1px solid var(--provatic-border);
	margin-bottom: 24px;
}

.provatic-members-mypage-tab {
	padding: 12px 20px;
	color: var(--provatic-text-muted);
	text-decoration: none;
	font-weight: 500;
	border-bottom: 2px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.provatic-members-mypage-tab:hover {
	color: var(--provatic-text);
}

.provatic-members-mypage-tab.is-active {
	color: var(--provatic-brand);
	border-bottom-color: var(--provatic-brand);
}

.provatic-members-profile h3 {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 600;
}

.provatic-members-fields {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 12px 16px;
	margin: 0 0 24px;
}

.provatic-members-fields dt {
	font-weight: 500;
	color: var(--provatic-text-muted);
}

.provatic-members-fields dd {
	margin: 0;
	color: var(--provatic-text);
}

.provatic-members-logout {
	color: var(--provatic-error);
	text-decoration: none;
	font-size: 13px;
}

.provatic-members-logout:hover {
	text-decoration: underline;
}

/* Title/subtitle styles for login form now live inside the
   `.provatic-members-login-card` rules near the top of this file — that
   wrapper is the single source of truth across page / modal / preview. */

/* ==========================================================================
   Tier-restriction fallback card (Tier_Restrict)
   - Shown in place of gated content when the visitor doesn't meet the
     required tier. Used by both the [provatic_tier_restrict] shortcode
     and the post-meta whole-page gate.
   ========================================================================== */

/* Layout uses flex column + `gap` instead of per-child `margin-bottom`,
   so theme resets like `p { margin: 0 }` (common in Elementor/Astra)
   can't collapse our spacing. Button uses `line-height: 1` + fixed
   height + inline-flex center so the text glyph sits in the exact
   vertical center regardless of font baseline asymmetry.
   `!important` is used on the few rules where page-builder themes
   inject high-specificity overrides (`.elementor h3`, `a { color }`,
   button reset). */
.provatic-tier-restrict {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 48px 40px;
	margin: 32px auto;
	max-width: 480px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	box-sizing: border-box;
}
.provatic-tier-restrict > * {
	margin: 0 !important;
}
.provatic-tier-restrict-icon {
	font-size: 44px !important;
	line-height: 1 !important;
}
.provatic-tier-restrict-title {
	font-size: 20px !important;
	line-height: 1.3 !important;
	font-weight: 700 !important;
	color: #111827 !important;
}
.provatic-tier-restrict-text {
	font-size: 14px !important;
	line-height: 1.6 !important;
	color: #6b7280 !important;
	max-width: 360px;
}
.provatic-tier-restrict-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
	width: 100%;
}
/* Single-line text: use the `line-height = height` trick instead of flex
   centering. Flex's cross-axis center aligns the line-box rather than the
   visible glyph, which on baseline-asymmetric fonts (most Korean web fonts —
   Pretendard, Noto Sans KR) renders visibly low even though the box itself
   is centered. line-height-equals-height makes single-line text deterministic
   regardless of font metrics or theme `vertical-align` injection. */
.provatic-tier-restrict-btn {
	display: inline-block !important;
	box-sizing: border-box !important;
	height: 48px !important;
	min-width: 130px;
	padding: 0 24px !important;
	margin: 0 !important;
	border-radius: 6px;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 46px !important; /* = height - (2 * border) */
	text-align: center !important;
	text-decoration: none !important;
	white-space: nowrap;
	vertical-align: middle !important;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.provatic-tier-restrict-btn--primary {
	background: #497AE8;
	color: #ffffff !important;
	border-color: #497AE8;
}
.provatic-tier-restrict-btn--primary:hover,
.provatic-tier-restrict-btn--primary:focus,
.provatic-tier-restrict-btn--primary:active {
	background: #3a66c9;
	border-color: #3a66c9;
	color: #ffffff !important;
}
.provatic-tier-restrict-btn--secondary {
	background: #ffffff;
	color: #374151 !important;
	border-color: #d1d5db;
}
.provatic-tier-restrict-btn--secondary:hover,
.provatic-tier-restrict-btn--secondary:focus,
.provatic-tier-restrict-btn--secondary:active {
	background: #f9fafb;
	color: #111827 !important;
}

/* "fallback=message" — plain inline notice without the full card. */
.provatic-tier-restrict-message {
	padding: 12px 16px;
	background: #f9fafb;
	border-left: 3px solid #497AE8;
	border-radius: 4px;
	color: #6b7280;
	font-size: 14px;
	margin: 16px 0;
}
