/* WB Phone OTP Login for WooCommerce — default form styling.
   All colors are defined as CSS custom properties on .wb-otp-form-wrap
   so themes/site owners can override them without editing this file. */

.wb-otp-form-wrap {
	--wb-otp-primary: #8fb996;
	--wb-otp-primary-dark: #6f9c78;
	--wb-otp-bg: #fdf8f3;
	--wb-otp-border: #e3d9cd;
	--wb-otp-text: #3c3530;
	--wb-otp-error: #c0503f;
	--wb-otp-success: #4c7a55;

	max-width: 380px;
	margin: 0 auto;
	padding: 28px 24px;
	background: var(--wb-otp-bg);
	border: 1px solid var(--wb-otp-border);
	border-radius: 14px;
	font-family: inherit;
	color: var(--wb-otp-text);
	box-sizing: border-box;
}

.wb-otp-form-wrap * {
	box-sizing: border-box;
}

.wb-otp-heading {
	margin: 0 0 16px;
	font-size: 1.25rem;
	text-align: center;
}

.wb-otp-message {
	min-height: 1.2em;
	margin-bottom: 12px;
	font-size: 0.9rem;
	text-align: center;
}

.wb-otp-message.wb-otp-error {
	color: var(--wb-otp-error);
}

.wb-otp-message.wb-otp-success {
	color: var(--wb-otp-success);
}

.wb-otp-form label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.9rem;
	font-weight: 600;
}

.wb-otp-form input[type="tel"],
.wb-otp-form input[type="text"] {
	width: 100%;
	padding: 10px 12px;
	margin-bottom: 14px;
	border: 1px solid var(--wb-otp-border);
	border-radius: 8px;
	font-size: 1rem;
	background: #fff;
	color: var(--wb-otp-text);
}

.wb-otp-form input:focus {
	outline: none;
	border-color: var(--wb-otp-primary);
	box-shadow: 0 0 0 3px rgba(143, 185, 150, 0.25);
}

.wb-otp-btn {
	width: 100%;
	padding: 11px 16px;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

/* Plugin/custom colour buttons. When the "match theme" style is active the
   button also carries the .wb-otp-btn--theme modifier plus the theme's own
   .button / .wp-element-button classes, so we skip our colour rules here and
   let the theme paint it. */
.wb-otp-btn:not(.wb-otp-btn--theme) {
	background: var(--wb-otp-primary);
	color: #fff;
	border: none;
}

.wb-otp-btn:not(.wb-otp-btn--theme):hover:not(:disabled) {
	background: var(--wb-otp-primary-dark);
}

/* Match-theme buttons: keep them full width and consistently spaced, but let
   the theme control colours, borders and typography. */
.wb-otp-btn--theme {
	width: 100%;
	display: block;
	text-align: center;
	margin: 0;
}

.wb-otp-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.wb-otp-link {
	display: inline-block;
	width: 100%;
	margin-top: 10px;
	background: none;
	border: none;
	color: var(--wb-otp-primary-dark);
	font-size: 0.85rem;
	text-align: center;
	text-decoration: underline;
	cursor: pointer;
	padding: 4px;
}

.wb-otp-link:disabled {
	color: #9c9c9c;
	cursor: not-allowed;
	text-decoration: none;
}

.wb-otp-phone-display {
	margin: 0 0 10px;
	font-size: 0.85rem;
	text-align: center;
	color: #6b6259;
}

.wb-otp-already-logged-in {
	text-align: center;
}

/* Hide WooCommerce's default password-based login/register columns on the
   My Account page when our OTP form has been inserted ahead of them and the
   site owner has chosen OTP-only mode. The body class is added conditionally
   (see WB_OTP_Shortcodes::add_body_classes), so in dual-method mode the
   default email/password form stays visible next to the OTP form. Scoped to
   the account page's #customer_login wrapper only, so checkout's separate
   "returning customer" login block is never affected. */
.woocommerce-account.wb-otp-hide-default-login #customer_login {
	display: none;
}

.wb-otp-myaccount-replacement {
	margin-bottom: 24px;
}

/* "OR" divider shown between the OTP form and the default login form when
   both are displayed together (dual-method mode). */
.wb-otp-login-divider {
	display: flex;
	align-items: center;
	max-width: 380px;
	margin: 0 auto 24px;
	color: #6b6259;
}

.wb-otp-login-divider::before,
.wb-otp-login-divider::after {
	content: "";
	flex: 1;
	border-bottom: 1px solid #e3d9cd;
}

.wb-otp-login-divider span {
	padding: 0 12px;
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Self-service "change phone number" widget on the Account details page. */
.wb-otp-change-phone-row {
	margin-bottom: 20px;
}

.wb-otp-change-phone-row input[readonly] {
	background: #f5f5f5;
	cursor: not-allowed;
}

.wb-otp-verified-badge {
	display: inline-block;
	margin-top: 4px;
	font-size: 0.8em;
	color: #4c7a55;
	font-weight: 600;
}

.wb-otp-verified-badge::before {
	content: "\2713\0020";
}

.wb-otp-change-phone-toggle {
	display: inline-block;
	margin-top: 6px;
	background: none;
	border: none;
	padding: 0;
	color: var(--wb-otp-primary-dark, #6f9c78);
	font-size: 0.85rem;
	text-decoration: underline;
	cursor: pointer;
}

.wb-otp-change-phone-panel {
	margin-top: 12px;
	padding: 16px;
	border: 1px solid #e3d9cd;
	border-radius: 10px;
	background: #fdf8f3;
}

.wb-otp-change-phone-panel .wb-otp-change-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.wb-otp-change-phone-panel .wb-otp-change-actions .button {
	margin: 0;
}

.wb-otp-change-message {
	min-height: 1.2em;
	margin-bottom: 10px;
	font-size: 0.9rem;
}

.wb-otp-change-message.wb-otp-error {
	color: #c0503f;
}

.wb-otp-change-message.wb-otp-success {
	color: #4c7a55;
}
