/**
 * Freemius Account page styles.
 *
 * Scoped to #fs_account and the client-site notice bar so styles never leak
 * outside this plugin's account pages.
 */

/* ── Page layout ─────────────────────────────────────────────────────── */

#fs_account {
	max-width: 780px;
	margin: 20px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#fs_account .has-sidebar-content {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* ── Postbox card ────────────────────────────────────────────────────── */

#fs_account .postbox {
	padding: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgb(0 0 0 / .06);
}

#fs_account .postbox h3 {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 14px 18px;
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	background: #f6f7f7;
	border-bottom: 1px solid #f0f0f1;
}

#fs_account .postbox h3 .dashicons {
	font-size: 18px;
	color: #16a34a;
}

/* ── Header action links ─────────────────────────────────────────────── */

#fs_account .fs-header-actions {
	padding: 10px 18px;
	background: #fafafa;
	border-bottom: 1px solid #f0f0f1;
}

#fs_account .fs-header-actions ul {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 4px;
	align-items: center;
	padding: 0;
	margin: 0;
	list-style: none;
}

#fs_account .fs-header-actions li {
	padding: 0;
	margin: 0;
	font-size: 12px;
	color: #8c8f94;
}

#fs_account .fs-header-actions li a,
#fs_account .fs-header-actions li .fs-deactivate-license {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	padding: 3px 8px;
	font-size: 12px;
	font-weight: 500;
	color: #50575e;
	text-decoration: none;
	cursor: pointer;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 4px;
	transition: color 120ms, background 120ms, border-color 120ms;
}

#fs_account .fs-header-actions li a:hover,
#fs_account .fs-header-actions li .fs-deactivate-license:hover {
	color: #16a34a;
	background: #f0fdf4;
	border-color: #bbf7d0;
}

#fs_account .fs-header-actions li a .dashicons,
#fs_account .fs-header-actions li .fs-deactivate-license .dashicons {
	width: 14px;
	height: 14px;
	font-size: 14px;
}

#fs_account .fs-header-actions form {
	display: inline;
	padding: 0;
	margin: 0;
}

/* ── Account details table ───────────────────────────────────────────── */

#fs_account_details {
	width: 100%;
	border-collapse: collapse;
}

#fs_account_details tr {
	border-bottom: 1px solid #f6f7f7;
}

#fs_account_details tr:last-child {
	border-bottom: none;
}

#fs_account_details tr.alternate {
	background: #fafafa;
}

#fs_account_details td {
	padding: 10px 18px;
	font-size: 13px;
	color: #1d2327;
	vertical-align: middle;
}

#fs_account_details td:first-child {
	width: 130px;
	font-weight: 500;
	color: #50575e;
	white-space: nowrap;
}

#fs_account_details td:first-child nobr {
	white-space: nowrap;
}

#fs_account_details td code {
	padding: 2px 6px;
	font-size: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	color: #16a34a;
	background: #f0fdf4;
	border: 1px solid #dcfce7;
	border-radius: 3px;
}

#fs_account_details td.fs-right {
	width: 1px;
	padding-right: 14px;
	white-space: nowrap;
	text-align: right;
}

/* ── Tags / badges ───────────────────────────────────────────────────── */

#fs_account .fs-tag {
	display: inline-block;
	padding: 2px 8px;
	margin-left: 6px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.6;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border-radius: 20px;
}

#fs_account .fs-tag.fs-success {
	color: #166534;
	background: #dcfce7;
	border: 1px solid #bbf7d0;
}

#fs_account .fs-tag.fs-warn {
	color: #854d0e;
	background: #fef9c3;
	border: 1px solid #fde68a;
}

#fs_account .fs-tag.fs-error {
	color: #991b1b;
	background: #fee2e2;
	border: 1px solid #fca5a5;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */

#fs_account .button.button-small,
#fs_account .button-group .button {
	height: 26px;
	padding: 0 10px;
	font-size: 11px;
	font-weight: 500;
	line-height: 24px;
	border-radius: 4px;
}

#fs_account .button-group {
	display: inline-flex;
	gap: 4px;
	align-items: center;
}

#fs_account .button-group .button {
	margin: 0;
}

/* Sync License / Change License — brand-accented */
#fs_account .button.activate-license-trigger,
#fs_account .button-group form .button[value="Sync License"] {
	color: #16a34a;
	border-color: #86efac;
}

#fs_account .button.activate-license-trigger:hover,
#fs_account .button-group form .button[value="Sync License"]:hover {
	color: #15803d;
	background: #f0fdf4;
	border-color: #86efac;
}

/* ── Beta programme checkbox ─────────────────────────────────────────── */

#fs_account .fs-field-beta_program label {
	display: flex;
	gap: 6px;
	align-items: center;
	font-size: 13px;
	color: #50575e;
}

/* ── Billing section ─────────────────────────────────────────────────── */

#fs_billing {
	padding: 0;
}

#fs_billing_address {
	width: 100%;
	border-collapse: collapse;
}

#fs_billing_address tr {
	border-bottom: 1px solid #f6f7f7;
}

#fs_billing_address tr:last-child {
	border-bottom: none;
}

#fs_billing_address td {
	padding: 10px 18px;
}

#fs_billing_address label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12px;
	color: #50575e;
}

#fs_billing_address label span {
	font-weight: 500;
	color: #50575e;
}

#fs_billing_address input[type="text"],
#fs_billing_address select {
	width: 100%;
	height: 30px;
	padding: 0 8px;
	font-size: 13px;
	color: #1d2327;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	transition: border-color 120ms, box-shadow 120ms;
}

#fs_billing_address input[type="text"]:focus,
#fs_billing_address select:focus {
	outline: none;
	border-color: #16a34a;
	box-shadow: 0 0 0 2px #f0fdf4;
}

/* Read-only mode: hide inputs, show plain text via placeholder */
#fs_billing_address.fs-read-mode input[type="text"],
#fs_billing_address.fs-read-mode select {
	color: #1d2327;
	pointer-events: none;
	background: transparent;
	border-color: transparent;
	border-bottom-color: #e0e0e0;
	border-radius: 0;
	box-shadow: none;
}

#fs_billing_address.fs-read-mode input[type="text"]:focus,
#fs_billing_address.fs-read-mode select:focus {
	border-color: transparent;
	border-bottom-color: #16a34a;
}

#fs_billing_address td:last-child {
	padding-top: 0;
}

#fs_billing_address .button {
	display: block;
	width: calc(100% - 36px);
	margin: 0 18px 14px;
	font-weight: 500;
	text-align: center;
}

#fs_billing_address .button.button-primary {
	color: #fff;
	background: #16a34a;
	border-color: #15803d;
}

#fs_billing_address .button.button-primary:hover {
	background: #15803d;
	border-color: #166534;
}

/* ── Payments table ──────────────────────────────────────────────────── */

#fs_payments .inside {
	padding: 0;
}

#fs_payments .inside .widefat {
	width: 100%;
	border: none;
	border-collapse: collapse;
}

#fs_payments .inside .widefat thead th {
	padding: 10px 18px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: #50575e;
	text-transform: uppercase;
	background: #fafafa;
	border-bottom: 1px solid #f0f0f1;
}

#fs_payments .inside .widefat tbody tr {
	border-bottom: 1px solid #f6f7f7;
}

#fs_payments .inside .widefat tbody tr:last-child {
	border-bottom: none;
}

#fs_payments .inside .widefat tbody tr.alternate {
	background: #fafafa;
}

#fs_payments .inside .widefat tbody td {
	padding: 10px 18px;
	font-size: 13px;
	color: #1d2327;
	vertical-align: middle;
}

#fs_payments .inside .widefat .button.button-small {
	color: #16a34a;
	border-color: #86efac;
}

#fs_payments .inside .widefat .button.button-small:hover {
	background: #f0fdf4;
	border-color: #86efac;
}

/* ── "Is this your client's site?" bar ──────────────────────────────── */

.storesheet_page_storesheet-account .wrap > .notice-info:not(.fs-notice),
.storesheet_page_storesheet-account .wrap > div[class*="notice"]:not(.fs-notice):not([class*="fs-slug"]) {
	max-width: 780px;
}

/* --------------------------------------------------------------------------
 * StoreSheet brand overrides for the Freemius v7 design-system palette.
 * Account buttons/inputs/links draw from a --fs-ds-blue-* / --app-color /
 * --wp-admin-theme-color scale the base re-skin didn't cover (they showed
 * WordPress blue). Remap that accent scale to emerald, scoped to #fs_account.
 * ------------------------------------------------------------------------- */
#fs_account {
	--app-color: #16a34a;
	--app-color-dark: #15803d;
	--wp-admin-theme-color: #16a34a;
	--wp-admin-theme-color-darker-10: #15803d;
	--wp-admin-theme-color-darker-20: #166534;
	--fs-ds-blue-10: #f0fdf4;
	--fs-ds-blue-50: #dcfce7;
	--fs-ds-blue-100: #bbf7d0;
	--fs-ds-blue-200: #86efac;
	--fs-ds-blue-300: #4ade80;
	--fs-ds-blue-400: #22c55e;
	--fs-ds-blue-500: #16a34a;
	--fs-ds-blue-600: #15803d;
	--fs-ds-blue-700: #166534;
	--fs-ds-blue-800: #14532d;
	--fs-ds-blue-900: #052e16;
}

/* Primary buttons (WP .button-primary uses the admin theme color for bg). */
#fs_account .button-primary,
#fs_account button.button-primary {
	background: var(--fs-brand, #16a34a);
	border-color: var(--fs-brand-dark, #15803d);
	color: #fff;
}

/* Secondary/plain buttons + links that carry the blue accent. */
#fs_account a,
#fs_account .button:not(.button-primary) {
	color: var(--fs-brand, #16a34a);
	border-color: var(--fs-brand, #16a34a);
}

/* Focused inputs. */
#fs_account input:focus,
#fs_account input {
	border-color: var(--fs-brand, #16a34a);
	outline-color: var(--fs-brand, #16a34a);
}
