/* =============================================================
   MACFW Registration Form — frontend styles
   All selectors scoped under .macfw-reg-wrap to prevent conflicts.
   ============================================================= */

/* --- CSS Variables (defaults; overridden by admin settings) ---- */
.macfw-reg-wrap {
	--macfw-rf-primary:      #4f46e5;
	--macfw-rf-primary-h:    #4338ca;
	--macfw-rf-btn-text:     #ffffff;
	--macfw-rf-card-bg:      #ffffff;
	--macfw-rf-label:        #374151;
	--macfw-rf-muted:        #6b7280;
	--macfw-rf-border:       #e5e7eb;
	--macfw-rf-input-bg:     #f9fafb;
	--macfw-rf-focus-ring:   rgba(79, 70, 229, 0.15);
	--macfw-rf-radius-input: 10px;
	--macfw-rf-radius-card:  20px;
	--macfw-rf-shadow:       0 20px 60px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.06);
}

/* --- Page-level wrapper (shortcode context) ------------------- */
.macfw-reg-wrap.macfw-reg-page {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12px 16px 48px;
}

/* --- Card ----------------------------------------------------- */
.macfw-reg-card {
	background: var(--macfw-rf-card-bg);
	border-radius: var(--macfw-rf-radius-card);
	box-shadow: var(--macfw-rf-shadow);
	width: 100%;
	max-width: 480px;
	padding: 48px 44px 40px;
	position: relative;
	box-sizing: border-box;
}

/* Gradient top accent bar */
.macfw-reg-card::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 5px;
	background: linear-gradient(90deg, var(--macfw-rf-primary) 0%, #a78bfa 50%, #60a5fa 100%);
	border-radius: var(--macfw-rf-radius-card) var(--macfw-rf-radius-card) 0 0;
}

/* --- Avatar icon at top --------------------------------------- */
.macfw-reg-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--macfw-rf-primary), #a78bfa);
	margin: 0 auto 20px;
	box-shadow: 0 6px 20px rgba(79,70,229,0.28);
}

.macfw-reg-card-icon .dashicons {
	font-size: 28px !important;
	width: 28px !important;
	height: 28px !important;
	color: #fff !important;
	line-height: 1 !important;
}

/* --- Card heading --------------------------------------------- */
.macfw-reg-card-heading {
	margin: 0 0 32px;
	text-align: center;
}

.macfw-reg-card-heading h2 {
	font-size: 24px !important;
	font-weight: 800 !important;
	color: var(--macfw-rf-label) !important;
	margin: 0 0 6px !important;
	padding: 0 !important;
	border: none !important;
	line-height: 1.2 !important;
	letter-spacing: -0.3px !important;
}

.macfw-reg-card-heading p {
	font-size: 14px;
	color: var(--macfw-rf-muted);
	margin: 0 !important;
	line-height: 1.5;
}

/* --- WooCommerce notices --------------------------------------- */
.macfw-reg-card .woocommerce-error,
.macfw-reg-card .woocommerce-message,
.macfw-reg-card .woocommerce-info {
	border-radius: 10px !important;
	margin-bottom: 22px !important;
	font-size: 13px !important;
	list-style: none !important;
	padding: 12px 16px !important;
}

/* --- Field wrapper -------------------------------------------- */
.macfw-reg-card .woocommerce-form-row,
.macfw-reg-card .form-row,
.macfw-reg-card p.macfw-reg-field {
	margin-bottom: 20px !important;
	padding: 0 !important;
	position: relative;
}

.macfw-reg-card .woocommerce-form-row:last-child,
.macfw-reg-card .form-row:last-child {
	margin-bottom: 0 !important;
}

/* --- Form labels ---------------------------------------------- */
.macfw-reg-card label,
.macfw-reg-card .woocommerce-form__label {
	display: block !important;
	font-size: 12px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.05em !important;
	color: var(--macfw-rf-muted) !important;
	margin-bottom: 7px !important;
	line-height: 1.4 !important;
}

.macfw-reg-card label .required {
	color: #ef4444;
	margin-left: 2px;
}

/* --- Inputs ---------------------------------------------------- */
.macfw-reg-card input[type="text"],
.macfw-reg-card input[type="email"],
.macfw-reg-card input[type="password"],
.macfw-reg-card input[type="tel"],
.macfw-reg-card input[type="number"],
.macfw-reg-card input[type="url"],
.macfw-reg-card input[type="date"],
.macfw-reg-card select,
.macfw-reg-card textarea {
	display: block !important;
	width: 100% !important;
	height: 48px !important;
	padding: 0 16px !important;
	border: 2px solid var(--macfw-rf-border) !important;
	border-radius: var(--macfw-rf-radius-input) !important;
	background: var(--macfw-rf-input-bg) !important;
	color: #111827 !important;
	font-size: 15px !important;
	font-family: inherit !important;
	line-height: 1 !important;
	transition: border-color 0.18s, box-shadow 0.18s, background 0.18s !important;
	box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
	outline: none !important;
	box-sizing: border-box !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.macfw-reg-card textarea {
	height: auto !important;
	min-height: 90px !important;
	padding: 12px 16px !important;
	line-height: 1.5 !important;
	resize: vertical !important;
}

.macfw-reg-card select {
	padding-right: 40px !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 14px center !important;
	background-size: 12px !important;
}

.macfw-reg-card input[type="text"]:focus,
.macfw-reg-card input[type="email"]:focus,
.macfw-reg-card input[type="password"]:focus,
.macfw-reg-card input[type="tel"]:focus,
.macfw-reg-card input[type="number"]:focus,
.macfw-reg-card input[type="url"]:focus,
.macfw-reg-card input[type="date"]:focus,
.macfw-reg-card select:focus,
.macfw-reg-card textarea:focus {
	border-color: var(--macfw-rf-primary) !important;
	box-shadow: 0 0 0 4px var(--macfw-rf-focus-ring) !important;
	background: #fff !important;
}

/* Input filled state — subtle border darkening */
.macfw-reg-card input[type="text"]:not(:placeholder-shown),
.macfw-reg-card input[type="email"]:not(:placeholder-shown),
.macfw-reg-card input[type="tel"]:not(:placeholder-shown),
.macfw-reg-card input[type="url"]:not(:placeholder-shown),
.macfw-reg-card input[type="number"]:not(:placeholder-shown) {
	border-color: #d1d5db !important;
	background: #fff !important;
}

/* --- Helper text below fields ---------------------------------- */
.macfw-reg-card .macfw-field-desc {
	display: block !important;
	font-size: 12px !important;
	color: var(--macfw-rf-muted) !important;
	margin-top: 5px !important;
	line-height: 1.4 !important;
}

/* --- Password strength meter ----------------------------------- */
.macfw-reg-card .woocommerce-password-strength {
	font-size: 12px !important;
	font-weight: 600 !important;
	margin-top: 8px !important;
	padding: 6px 12px !important;
	border-radius: 6px !important;
	border: none !important;
	background: #f3f4f6 !important;
	color: var(--macfw-rf-muted) !important;
}

.macfw-reg-card .woocommerce-password-strength.strong {
	background: #dcfce7 !important;
	color: #166534 !important;
}

.macfw-reg-card .woocommerce-password-strength.good {
	background: #d1fae5 !important;
	color: #065f46 !important;
}

.macfw-reg-card .woocommerce-password-strength.short,
.macfw-reg-card .woocommerce-password-strength.bad {
	background: #fee2e2 !important;
	color: #991b1b !important;
}

.macfw-reg-card .woocommerce-password-hint {
	font-size: 12px !important;
	color: var(--macfw-rf-muted) !important;
	margin-top: 6px !important;
	line-height: 1.5 !important;
}

/* --- Show/hide password toggle --------------------------------- */
.macfw-reg-card .woocommerce-Input-wrapper {
	position: relative !important;
}

.macfw-reg-card .woocommerce-Input-wrapper input {
	padding-right: 48px !important;
}

.macfw-reg-card .woocommerce-Input__show-password-input {
	position: absolute !important;
	right: 14px !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	background: none !important;
	border: none !important;
	padding: 0 !important;
	cursor: pointer !important;
	color: var(--macfw-rf-muted) !important;
	line-height: 1 !important;
	display: flex !important;
	align-items: center !important;
	height: auto !important;
	width: auto !important;
	box-shadow: none !important;
}

/* --- Checkbox field type --------------------------------------- */
.macfw-reg-card .macfw-checkbox-row {
	display: flex !important;
	align-items: flex-start !important;
	gap: 10px !important;
	cursor: pointer !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	color: #1f2937 !important;
	line-height: 1.5 !important;
}

.macfw-reg-card .macfw-checkbox-row input[type="checkbox"] {
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	margin-top: 2px !important;
	accent-color: var(--macfw-rf-primary) !important;
	flex-shrink: 0 !important;
	-webkit-appearance: auto !important;
	appearance: auto !important;
}

/* --- Terms row ------------------------------------------------- */
.macfw-reg-card .macfw-terms-row {
	margin-top: 6px !important;
	margin-bottom: 20px !important;
}

.macfw-reg-card .macfw-terms-row label {
	display: flex !important;
	align-items: flex-start !important;
	gap: 10px !important;
	cursor: pointer !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	color: var(--macfw-rf-muted) !important;
	line-height: 1.5 !important;
}

.macfw-reg-card .macfw-terms-row input[type="checkbox"] {
	width: 17px !important;
	height: 17px !important;
	min-width: 17px !important;
	margin-top: 2px !important;
	accent-color: var(--macfw-rf-primary) !important;
	-webkit-appearance: auto !important;
	appearance: auto !important;
}

.macfw-reg-card .macfw-terms-row a {
	color: var(--macfw-rf-primary);
	text-decoration: none;
	font-weight: 600;
}

.macfw-reg-card .macfw-terms-row a:hover {
	text-decoration: underline;
}

/* --- Divider before submit ------------------------------------ */
.macfw-reg-card .macfw-reg-submit-row {
	margin-top: 8px !important;
}

/* --- Submit button -------------------------------------------- */
.macfw-reg-card button[type="submit"],
.macfw-reg-card input[type="submit"],
.macfw-reg-card .woocommerce-Button,
.macfw-reg-card .woocommerce-form-register__submit,
.macfw-reg-card .woocommerce-form-login__submit {
	display: block !important;
	width: 100% !important;
	height: 52px !important;
	padding: 0 24px !important;
	background: linear-gradient(135deg, var(--macfw-rf-primary) 0%, var(--macfw-rf-primary-h) 100%) !important;
	color: var(--macfw-rf-btn-text) !important;
	border: none !important;
	border-radius: var(--macfw-rf-radius-input) !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	font-family: inherit !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
	cursor: pointer !important;
	transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s !important;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
	line-height: 1 !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.macfw-reg-card button[type="submit"]:hover,
.macfw-reg-card input[type="submit"]:hover,
.macfw-reg-card .woocommerce-form-register__submit:hover,
.macfw-reg-card .woocommerce-form-login__submit:hover {
	opacity: 0.92 !important;
	transform: translateY(-2px) !important;
	box-shadow: 0 8px 24px rgba(79, 70, 229, 0.40) !important;
}

.macfw-reg-card button[type="submit"]:active,
.macfw-reg-card input[type="submit"]:active {
	transform: translateY(0) !important;
}

.macfw-reg-card button[type="submit"]:disabled,
.macfw-reg-card input[type="submit"]:disabled {
	opacity: 0.55 !important;
	cursor: not-allowed !important;
	transform: none !important;
}

/* --- Login link below form ------------------------------------ */
.macfw-reg-login-link {
	text-align: center;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--macfw-rf-border);
	font-size: 13px;
	color: var(--macfw-rf-muted);
}

.macfw-reg-login-link a {
	color: var(--macfw-rf-primary);
	font-weight: 700;
	text-decoration: none;
}

.macfw-reg-login-link a:hover {
	text-decoration: underline;
}

/* --- Remember me / checkbox label (login form) ---------------- */
.macfw-reg-card .woocommerce-form__label-for-checkbox {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	color: var(--macfw-rf-muted) !important;
	cursor: pointer !important;
}

.macfw-reg-card .woocommerce-form__input-checkbox {
	width: 16px !important;
	height: 16px !important;
	min-width: 16px !important;
	margin: 0 !important;
	accent-color: var(--macfw-rf-primary) !important;
}

/* --- Lost password -------------------------------------------- */
.macfw-reg-card .woocommerce-LostPassword,
.macfw-reg-card .lost_password {
	margin-top: 14px !important;
	font-size: 13px !important;
}

.macfw-reg-card .woocommerce-LostPassword a,
.macfw-reg-card .lost_password a {
	color: var(--macfw-rf-primary) !important;
	text-decoration: none !important;
	font-weight: 500 !important;
}

.macfw-reg-card .woocommerce-LostPassword a:hover,
.macfw-reg-card .lost_password a:hover {
	text-decoration: underline !important;
}

/* --- Privacy policy text -------------------------------------- */
.macfw-reg-card .woocommerce-privacy-policy-text {
	font-size: 12px !important;
	color: #9ca3af !important;
	margin-top: 10px !important;
	line-height: 1.5 !important;
}

.macfw-reg-card .woocommerce-privacy-policy-text a {
	color: var(--macfw-rf-primary) !important;
	text-decoration: none !important;
}

/* --- Login/Register tab switcher ------------------------------ */
.macfw-form-tabs {
	display: flex;
	border-radius: 10px;
	background: var(--macfw-rf-input-bg);
	border: 2px solid var(--macfw-rf-border);
	padding: 3px;
	margin-bottom: 28px;
	gap: 3px;
}

.macfw-form-tab {
	flex: 1;
	height: 38px;
	background: transparent;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--macfw-rf-muted);
	cursor: pointer;
	transition: all 0.18s;
	font-family: inherit;
}

.macfw-form-tab.macfw-tab-active {
	background: #fff;
	color: var(--macfw-rf-primary);
	box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.macfw-form-tab:hover:not(.macfw-tab-active) {
	color: var(--macfw-rf-label);
}

/* --- On My Account page (inside the WC content area) ---------- */
.woocommerce-MyAccount-content .macfw-reg-wrap .macfw-reg-card {
	max-width: 100%;
	box-shadow: none;
	border: 1px solid var(--macfw-rf-border);
}

/* --- "already logged in" notice ------------------------------- */
.macfw-already-logged-in {
	text-align: center;
	padding: 20px;
	font-size: 14px;
	color: var(--macfw-rf-muted);
}

.macfw-already-logged-in a {
	color: var(--macfw-rf-primary);
	font-weight: 600;
	text-decoration: none;
}

/* --- Responsive ----------------------------------------------- */
@media (max-width: 540px) {
	.macfw-reg-card {
		padding: 36px 24px 28px;
		border-radius: 14px;
	}

	.macfw-reg-card-heading h2 {
		font-size: 21px !important;
	}

	.macfw-reg-card-icon {
		width: 56px;
		height: 56px;
	}
}
