/**
 * Password generator — inline "suggest" link and generated-password dialog.
 *
 * Visual mirrors the Smart Checkout Flow popup and inherits the site accent via
 * --ck-accent (blue fallback). Button/link visuals are forced with higher
 * specificity + !important because store themes style `button`/`a` elements
 * with rules that would otherwise override our single-class styles.
 *
 * @package Woo_Otimizations
 */

.ow-pg-suggest,
.ow-pg-modal { --ow-pg-accent: var( --ck-accent, #2271b1 ); }

/* Inline trigger: a text link with a padlock, placed below the password field. */
.ow-pg-suggest {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	margin: 8px 0 16px !important;
	padding: 0 !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	color: var( --ow-pg-accent ) !important;
	background: none !important;
	box-shadow: none !important;
	text-decoration: none !important;
	cursor: pointer;
	width: auto !important;
}
.ow-pg-suggest:hover { text-decoration: underline !important; filter: brightness( .85 ); }
.ow-pg-suggest svg { flex: 0 0 auto; }
/* Only clickable once the account e-mail is filled. */
.ow-pg-suggest.is-disabled { color: #a7aaad !important; cursor: not-allowed; pointer-events: none; text-decoration: none !important; }
.ow-pg-suggest.is-disabled svg { opacity: .5; }

/* Overlay + dialog */
.ow-pg-overlay {
	position: fixed;
	inset: 0;
	background: rgba( 0, 0, 0, .5 );
	z-index: 100000;
	display: none;
	backdrop-filter: blur( 2px );
}
.ow-pg-overlay.is-open { display: block; }

.ow-pg-modal {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate( -50%, -50% );
	background: #fff;
	border-radius: 12px;
	padding: 20px;
	width: 92%;
	max-width: 380px;
	z-index: 100001;
	display: none;
	box-shadow: 0 12px 40px rgba( 0, 0, 0, .22 );
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1d2327;
}
.ow-pg-modal.is-open { display: block; }

.ow-pg-modal .ow-pg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ow-pg-modal .ow-pg-head strong { font-size: 16px; font-weight: 700; color: #1d2327; line-height: 1.3; }
.ow-pg-modal .ow-pg-x { border: 0 !important; background: none !important; box-shadow: none !important; font-size: 22px !important; line-height: 1; color: #6a717a !important; cursor: pointer; padding: 0 2px !important; width: auto !important; min-height: 0 !important; }
.ow-pg-modal .ow-pg-x:hover { color: #1d2327 !important; }

.ow-pg-modal .ow-pg-sub { margin: 6px 0 14px; font-size: 12.5px; line-height: 1.5; color: #50575e; }

/* Password box: dashed frame, monospace value + inline copy button. */
.ow-pg-modal .ow-pg-box {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 9px 9px 14px;
	border: 1px dashed #c3ccd9;
	border-radius: 8px;
	background: #f7f9fc;
}
.ow-pg-modal .ow-pg-pass {
	flex: 1 1 auto;
	min-width: 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .5px;
	color: #1d2327;
	word-break: break-all;
	background: transparent;
}

/* Shared button reset so no theme `button` rule bleeds in. */
.ow-pg-modal .ow-pg-copy,
.ow-pg-modal .ow-pg-actions button {
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-family: inherit !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	min-height: 0 !important;
	width: auto !important;
	margin: 0 !important;
	cursor: pointer !important;
	transition: filter .15s ease, background-color .15s ease, border-color .15s ease !important;
}

.ow-pg-modal .ow-pg-copy {
	flex: 0 0 auto;
	border: 0 !important;
	border-radius: 7px !important;
	background: var( --ow-pg-accent ) !important;
	color: #fff !important;
	padding: 8px 16px !important;
}
.ow-pg-modal .ow-pg-copy:hover { filter: brightness( .9 ); }

/* Copied confirmation (green). */
.ow-pg-modal .ow-pg-copied {
	display: none;
	margin-top: 10px;
	padding: 8px 12px;
	border: 1px solid #a7e0b5;
	border-radius: 7px;
	background: #eafaef;
	color: #1a7f37;
	font-size: 12.5px;
	font-weight: 600;
	text-align: center;
}
.ow-pg-modal .ow-pg-copied.is-show { display: block; }

.ow-pg-modal .ow-pg-tip { margin: 12px 0 0; font-size: 11.5px; line-height: 1.5; color: #6a717a; }

/* Footer actions: "Generate another" (secondary) + "Use this password" (primary). */
.ow-pg-modal .ow-pg-actions { display: flex; gap: 10px; margin-top: 16px; }
.ow-pg-modal .ow-pg-actions button {
	flex: 1 1 0 !important;
	padding: 10px 12px !important;
	border-radius: 8px !important;
}
.ow-pg-modal .ow-pg-regen { border: 1px solid #c3c4c7 !important; background: #fff !important; color: #2c3338 !important; }
.ow-pg-modal .ow-pg-regen:hover { border-color: #8c8f94 !important; background: #f6f7f7 !important; }
.ow-pg-modal .ow-pg-use { border: 1px solid transparent !important; background: var( --ow-pg-accent ) !important; color: #fff !important; }
.ow-pg-modal .ow-pg-use:hover { filter: brightness( .9 ); }
