/*
 * Glow onboarding UI styles (Tracks A + B + connection-code fallback)
 *
 * Reuses the existing .glow-cards / .glow-card / .glow-button / .btn-pink
 * / .btn-outline / .input-wrapper patterns from glow-admin.css for layout
 * and chrome. This file only adds form-field styling and the small bits
 * (headline, subtitle, status banner, trust signal, success state) that
 * the existing CSS doesn't cover.
 */

.glow-onboard {
	--glow-primary: #dc2a6b;
	--glow-primary-dark: #A41F6B;
	--glow-purple: #301c59;
	--glow-text: #1f2937;
	--glow-text-muted: #6b7280;
	--glow-text-subtle: #9ca3af;
	--glow-border: #e5e7eb;
	--glow-bg-soft: #f9fafb;
	--glow-success-bg: #ecfdf5;
	--glow-success-text: #065f46;
	--glow-success-border: #a7f3d0;
	--glow-error-bg: #fef2f2;
	--glow-error-text: #991b1b;
	--glow-error-border: #fecaca;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Headline above the two cards */
.glow-onboard__headline {
	text-align: center;
	padding: 16px 24px 28px;
	max-width: 720px;
	margin: 0 auto;
}

.glow-onboard__headline h1 {
	font-size: 24px;
	line-height: 1.3;
	color: var(--glow-purple);
	margin: 0 0 8px;
	font-weight: 600;
}

.glow-onboard__headline p {
	color: var(--glow-text-muted);
	font-size: 14px;
	margin: 0;
}

/* Subtitle under the card title (inside .glow-card). Left-aligned, faded, generous padding. */
.glow-card .glow-onboard__subtitle {
	text-align: left;
	color: var(--glow-text-muted);
	font-size: 13px;
	line-height: 1.5;
	margin: 16px 0 24px;
	padding: 0;
}

/* The existing .glow-card sets `.glow-card .glow-button { margin-top: 15px }`. We want the
 * Track A submit button styled as a primary CTA, not the default chrome-less .glow-button.
 * Match the same pink palette used by `.glow-card a.btn-pink`. */
.glow-card button.btn-pink {
	background: #E52868;
	color: #fff;
	border: 1px solid #E52868;
	font-weight: bold;
	width: 100%;
	margin-top: 18px;
	cursor: pointer;
}

.glow-card button.btn-pink:hover:not(:disabled) {
	color: #E52868;
	background: #fff;
	border: 1px solid #E52868;
}

.glow-card button.btn-pink:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Track B card has two views (#glow-onboard-trackb-auto / -trackb-manual) swapped
 * by JS. The visible view must fill the card height so the bottom-anchored link
 * (.glow-onboard__manual-link below) ends up at the card's bottom edge. */
#glow-onboard-trackb-auto,
#glow-onboard-trackb-manual {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

/* "Prefer to add this site manually?" / "Add site automatically to Glow" link
 * inside the Track B card. margin-top:auto pushes it to the bottom of its flex
 * parent (the view div above) so it sits at the bottom of the card regardless
 * of how tall the sibling Track A card is. */
.glow-card .glow-onboard__manual-link {
	text-align: center;
	margin: auto 0 0;
	padding-top: 14px;
}

/* "Copy code" button (and any other <button> in the onboard area) is full width
 * by default. <a class="glow-button"> elements are already full-width via the
 * legacy .glow-card a.glow-button { display: block } rule. */
#glow-onboard-cta button.glow-button {
	width: 100%;
}

.glow-card .glow-onboard__manual-link a {
	font-size: 13px;
	color: #E52868;
	text-decoration: none;
}

.glow-card .glow-onboard__manual-link a:hover {
	text-decoration: underline;
}

/* Form fields */
.glow-card .glow-onboard__field {
	text-align: left;
	margin-bottom: 14px;
}

.glow-card .glow-onboard__field-label {
	display: block;
	text-align: left;
	font-size: 12px;
	font-weight: 500;
	color: var(--glow-text-subtle);
	margin: 0 0 4px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

/* Override the existing .glow-card input rule so the field input fills the card and is left-aligned. */
.glow-card .glow-onboard__field-input {
	width: 100%;
	padding: 9px 12px;
	font-size: 14px;
	font-family: inherit;
	color: var(--glow-text);
	background: #fff;
	border: 1px solid var(--glow-border);
	border-radius: 6px;
	text-align: left;
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.glow-card .glow-onboard__field-input:focus {
	outline: none;
	border-color: var(--glow-primary);
	box-shadow: 0 0 0 3px rgba(220, 42, 107, 0.12);
}

.glow-card .glow-onboard__field-error {
	font-size: 12px;
	color: var(--glow-error-text);
	margin-top: 4px;
	text-align: left;
}

.glow-card .glow-onboard__field-error:empty {
	display: none;
}

/* Status banner inside a card (success/error after submit) */
.glow-card .glow-onboard__status {
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 13px;
	margin-bottom: 14px;
	display: none;
	text-align: left;
}

.glow-card .glow-onboard__status.is-visible {
	display: block;
}

.glow-card .glow-onboard__status--success {
	background: var(--glow-success-bg);
	color: var(--glow-success-text);
	border: 1px solid var(--glow-success-border);
}

.glow-card .glow-onboard__status--error {
	background: var(--glow-error-bg);
	color: var(--glow-error-text);
	border: 1px solid var(--glow-error-border);
}

/* Trust signal under the primary CTA */
.glow-card .glow-onboard__trust {
	text-align: center;
	font-size: 12px;
	color: var(--glow-text-subtle);
	margin: 12px 0 0;
	padding: 0;
}

/* "Learn more about Glow →" link under the trust signal */
.glow-card .glow-onboard__learn-more {
	text-align: center;
	margin: 14px 0 0;
	padding: 0;
}

.glow-card .glow-onboard__learn-more a {
	font-size: 13px;
	color: #E52868;
	text-decoration: none;
}

.glow-card .glow-onboard__learn-more a:hover {
	text-decoration: underline;
}

/* Track A success screen */
.glow-card .glow-onboard__success-screen {
	text-align: center;
	padding: 16px 0;
}

.glow-card .glow-onboard__success-screen svg {
	width: 48px;
	height: 48px;
	color: var(--glow-success-text);
	margin-bottom: 12px;
}

.glow-card .glow-onboard__success-screen h3 {
	font-size: 18px;
	margin: 0 0 6px;
	color: var(--glow-text);
}

.glow-card .glow-onboard__success-screen p {
	color: var(--glow-text-muted);
	font-size: 14px;
	margin: 0 0 18px;
}

/* Button loading spinner (used inside .btn-pink while submitting) */
.glow-onboard__spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: glow-onboard-spin 0.7s linear infinite;
	margin-right: 8px;
	vertical-align: middle;
}

@keyframes glow-onboard-spin {
	to { transform: rotate(360deg); }
}

/* Mobile: stack the two side-by-side cards */
@media (max-width: 720px) {
	#glow-onboard-cta .glow-cards {
		flex-direction: column;
	}
	#glow-onboard-cta .w-50 {
		width: 100%;
	}
}
