/* ==========================================================================
   TattooClub — Global Form Validation System (design tokens + component
   library only; NO markup is generated here and NO backend validation is
   replaced — see form-validation.js for the matching behavior layer).

   Scope: applies consistent field/button/message states across every real
   TattooClub form (Contact, Newsletter, Login/Register, Lost/Reset
   password, My Account, Reviews, Back in Stock, Wishlist/share). Checkout
   keeps its own existing checkout.js/.css system — this file only adds
   matching visual states for WooCommerce's OWN real validation classes
   (.woocommerce-invalid / .woocommerce-validated) so Checkout looks
   consistent with the rest of the site without a second validator.
   ========================================================================== */

:root {
	--tc-black: #111111;
	--tc-ivory: #F9F5EF;
	--tc-white: #FFFFFF;
	--tc-green: #B7E41C;
	--tc-grey: #68645E;
	--tc-grey-light: #94908A;
	--tc-line: #DAD4C8;
	--tc-red: #E24C4C;
	--tc-red-bg: #FBE4E6;
	--tc-amber: #C98A1F;
	--tc-amber-bg: #FBF1DF;
	--tc-info: #2D6CDF;
	--tc-info-bg: #E8F0FE;
}

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

/* --------------------------------------------------------------------
   1. Field states — default / focus / valid / invalid / disabled
   -------------------------------------------------------------------- */

.tc-fv-field,
.woocommerce-account .woocommerce-form-row .input-text,
.woocommerce-account .woocommerce-form-row select,
.woocommerce-account .woocommerce-form-row textarea {
	transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

/* Generic state classes my JS applies to any input/select/textarea it wires
   (Contact, Newsletter, Login/Register, Lost/Reset password, Reviews,
   Back in Stock, Wishlist share). Safe to combine with a form's own base
   input styling — these only touch border/shadow/background, never layout. */
input.tc-fv-invalid,
select.tc-fv-invalid,
textarea.tc-fv-invalid,
.tc-fv-field.tc-fv-invalid {
	border-color: var(--tc-red) !important;
	box-shadow: 0 0 0 1px var(--tc-red) inset;
	background: var(--tc-red-bg);
}
input.tc-fv-valid,
select.tc-fv-valid,
textarea.tc-fv-valid,
.tc-fv-field.tc-fv-valid {
	border-color: var(--tc-green) !important;
	box-shadow: 0 0 0 1px var(--tc-green) inset;
}
input.tc-fv-field:focus,
select.tc-fv-field:focus,
textarea.tc-fv-field:focus,
.tc-fv-field:focus-within {
	outline: none;
	border-color: var(--tc-black) !important;
	box-shadow: 0 0 0 2px rgba(17,17,17,.12);
}
input.tc-fv-invalid:focus,
textarea.tc-fv-invalid:focus,
select.tc-fv-invalid:focus {
	box-shadow: 0 0 0 2px rgba(226,76,76,.18);
}
input:disabled.tc-fv-field,
select:disabled.tc-fv-field,
textarea:disabled.tc-fv-field,
.tc-fv-field:disabled {
	opacity: .55; cursor: not-allowed; background: var(--tc-line);
}

/* WooCommerce's OWN real validation classes — Checkout (and anywhere else
   WC toggles these natively) — styled to match the same design language,
   no logic added/duplicated. */
/* Non-!important, lower-specificity fallback: pages with their own more
   specific .woocommerce-invalid/.woocommerce-validated styling (Checkout's
   checkout.css, My Account's account.css) keep winning unchanged. This only
   fills the gap on pages with no dedicated CSS yet (e.g. the default
   WooCommerce Lost/Reset password templates). */
.woocommerce form .form-row.woocommerce-invalid input.input-text,
.woocommerce form .form-row.woocommerce-invalid select,
.woocommerce form .form-row.woocommerce-invalid textarea,
.woocommerce form .form-row.woocommerce-invalid .select2-selection {
	border-color: var(--tc-red);
	background: var(--tc-red-bg);
}
.woocommerce form .form-row.woocommerce-validated input.input-text,
.woocommerce form .form-row.woocommerce-validated select,
.woocommerce form .form-row.woocommerce-validated .select2-selection {
	border-color: var(--tc-green);
}

/* Required-field marker */
.tc-fv-required { color: var(--tc-red); margin-left: 2px; }

/* Inline field help / error text under a field */
.tc-fv-help {
	display: block; margin-top: 6px; font-size: 12.5px; color: var(--tc-grey);
}
.tc-fv-error {
	display: flex; align-items: flex-start; gap: 6px;
	margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--tc-red);
	line-height: 1.35;
}
.tc-fv-error::before {
	content: "\26A0"; font-size: 12px; line-height: 1.4; flex: 0 0 auto;
}
.tc-fv-error:empty { display: none; }

/* --------------------------------------------------------------------
   2. Password requirements checklist + show/hide (registration/reset)
   -------------------------------------------------------------------- */
.tc-fv-pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.tc-fv-pw-rules li {
	display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tc-grey);
}
.tc-fv-pw-rules li::before {
	content: ""; width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
	border: 1.5px solid var(--tc-line); background: transparent;
}
.tc-fv-pw-rules li.is-met { color: var(--tc-black); font-weight: 600; }
.tc-fv-pw-rules li.is-met::before {
	border-color: var(--tc-green); background: var(--tc-green);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23111' d='M6.4 10.8 3.6 8l-1 1 3.8 3.8L14 6.2l-1-1z'/%3E%3C/svg%3E");
	background-size: 10px; background-repeat: no-repeat; background-position: center;
}

/* --------------------------------------------------------------------
   3. Checkbox / Radio — required + optional
   -------------------------------------------------------------------- */
.tc-fv-check-row { display: flex; align-items: flex-start; gap: 9px; }
.tc-fv-check-row input[type="checkbox"],
.tc-fv-check-row input[type="radio"] {
	width: 18px; height: 18px; accent-color: var(--tc-green); margin-top: 2px; flex: 0 0 auto;
}
.tc-fv-check-row.tc-fv-invalid label { color: var(--tc-red); }
.tc-fv-check-row.tc-fv-invalid input[type="checkbox"],
.tc-fv-check-row.tc-fv-invalid input[type="radio"] {
	outline: 2px solid var(--tc-red); outline-offset: 2px; border-radius: 3px;
}

/* --------------------------------------------------------------------
   4. Buttons — default / hover / disabled / loading
   -------------------------------------------------------------------- */
.tc-fv-btn-loading {
	position: relative; color: transparent !important; pointer-events: none; opacity: .85 !important;
}
.tc-fv-btn-loading::after {
	content: ""; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px;
	margin: -8px 0 0 -8px; border-radius: 50%;
	border: 2px solid rgba(0,0,0,.25); border-top-color: currentColor;
	animation: tc-fv-spin .6s linear infinite; color: var(--tc-black);
}
button.tc-fv-btn-loading[style*="background: var(--tc-black)"]::after,
.tc-btn--primary.tc-fv-btn-loading::after { color: var(--tc-black); border-color: rgba(0,0,0,.2); border-top-color: var(--tc-black); }

/* --------------------------------------------------------------------
   5. Global feedback messages (success / error / info / warning) —
   reusable, compact inline banner for any form that doesn't already have
   its own dedicated message UI.
   -------------------------------------------------------------------- */
.tc-fv-msg {
	display: flex; align-items: flex-start; gap: 10px;
	padding: 12px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
	line-height: 1.4; margin: 12px 0 0;
}
.tc-fv-msg[hidden] { display: none; }
.tc-fv-msg strong { font-weight: 700; }
.tc-fv-msg--success { background: rgba(183,228,28,.18); color: #37440A; }
.tc-fv-msg--error { background: var(--tc-red-bg); color: #7A1B27; }
.tc-fv-msg--info { background: var(--tc-info-bg); color: #17417A; }
.tc-fv-msg--warning { background: var(--tc-amber-bg); color: #6B4409; }

@media (max-width: 480px) {
	.tc-fv-msg { font-size: 13px; padding: 11px 12px; }
	.tc-fv-error { font-size: 12px; }
}
