/**
 * The account portal. Builds on form.css (fields, buttons, notices) and uses the same
 * theme tokens with the same fallbacks; only what the portal adds is here.
 */

/* No width or margin of its own: the theme's layout (a block theme's constrained
   content column, or a classic theme's content area) places the portal exactly as it
   places the page title, so both share one left edge. Setting either here would
   override the theme's own rule. form.css's .novakey-exchange width is undone below
   without naming a width. */

.novakey-account__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-bottom: 1.5rem;
}

.novakey-account__bar form,
.novakey-account__who {
	margin: 0;
}

.novakey-account__section {
	margin: 0 0 2rem;
}

.novakey-account__section h2 {
	margin: 0 0 0.75rem;
	font-size: 1.25rem;
}

.novakey-account__licence {
	margin: 0 0 1rem;
	padding: 1.1rem 1.25rem;
	border: 1px solid var( --nk-border-color, #84848426 );
	border-radius: var( --nk-btn-radius, 0.5rem );
	background: rgb( var( --nk-surface, 255 255 255 ) );
}

.novakey-account__licence h3 {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.6rem;
	font-size: 1.05rem;
}

.novakey-account__tag {
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	background: rgb( var( --nk-accent, 34 113 177 ) / 0.12 );
	color: rgb( var( --nk-accent, 34 113 177 ) );
	font-size: 0.78rem;
	font-weight: 600;
}

.novakey-account__tag--expired,
.novakey-account__tag--revoked {
	background: rgb( 180 35 24 / 0.1 );
	color: rgb( 180 35 24 );
}

.novakey-account__keyline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 0 0 0.6rem;
}

.novakey-account__key {
	font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.05rem;
	letter-spacing: 0.04em;
	overflow-wrap: anywhere;
}

.novakey-account__facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.25rem 1rem;
	margin: 0 0 0.75rem;
}

.novakey-account__facts dt {
	color: rgb( var( --nk-body-text, 29 35 39 ) / 0.65 );
}

.novakey-account__facts dd {
	margin: 0;
}

.novakey-account__sites {
	margin: 0;
	padding: 0;
	list-style: none;
}

.novakey-account__sites li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.25rem 1rem;
	padding: 0.4rem 0;
	border-top: 1px solid var( --nk-border-color, #84848426 );
	overflow-wrap: anywhere;
}

/* One button system, scoped to the portal (the selectors outrank form.css's
   `button[type="submit"]`, which loads first and makes every submit full-width):
     primary   .novakey-account__button   Download, Email me a link, Sign in
     secondary + --secondary              Manage billing
     text      .novakey-account__link     Sign out, Reveal, Free this slot
   No theme underline leaks into any of them. */
.novakey-account.novakey-exchange .novakey-account__button,
.novakey-account.novakey-exchange button.novakey-account__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: auto;
	min-height: 2.5rem;
	margin: 0;
	padding: 0.5rem 1.1rem;
	border: 1px solid transparent;
	border-radius: var( --nk-btn-radius, 0.5rem );
	background: var( --nk-btn-primary-bg, #2271b1 );
	color: var( --nk-btn-primary-text, #fff );
	font: inherit;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
}

.novakey-account.novakey-exchange .novakey-account__button:hover,
.novakey-account.novakey-exchange .novakey-account__button:focus-visible {
	opacity: 0.9;
	text-decoration: none;
}

.novakey-account.novakey-exchange .novakey-account__button--secondary,
.novakey-account.novakey-exchange button.novakey-account__button--secondary {
	border-color: var( --nk-border-color, #84848466 );
	background: transparent;
	color: inherit;
}

.novakey-account.novakey-exchange .novakey-account__button--secondary:hover,
.novakey-account.novakey-exchange .novakey-account__button--secondary:focus-visible {
	background: rgb( var( --nk-accent, 34 113 177 ) / 0.08 );
	opacity: 1;
}

.novakey-account.novakey-exchange .novakey-account__button:focus-visible,
.novakey-account.novakey-exchange .novakey-account__link:focus-visible {
	outline: 2px solid rgb( var( --nk-accent, 34 113 177 ) );
	outline-offset: 2px;
}

/* The Download button sits beside its label, with room between them; on a narrow
   screen it wraps under it. A flex gap, not a margin: the shared button rule above
   resets margins and outranks a plain descendant selector. */
.novakey-account .novakey-account__download {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.75rem;
}

/* Text actions: no fill, no underline until hover or focus, the theme's text colour. */
.novakey-account.novakey-exchange .novakey-account__link,
.novakey-account.novakey-exchange button.novakey-account__link {
	display: inline;
	width: auto;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
}

.novakey-account.novakey-exchange .novakey-account__link:hover,
.novakey-account.novakey-exchange .novakey-account__link:focus-visible {
	opacity: 1;
	text-decoration: underline;
}

.novakey-account.novakey-exchange .novakey-account__link:disabled {
	opacity: 0.5;
	cursor: wait;
}

/* "Link sent": a neutral notice, not an error. */
.novakey-account .novakey-account__notice {
	margin: 0 0 1.5rem;
	padding: 0.9rem 1.1rem;
	border-left: 3px solid rgb( var( --nk-accent, 34 113 177 ) );
	background: rgb( var( --nk-accent, 34 113 177 ) / 0.07 );
	color: inherit;
	font-size: 0.95rem;
}

@media ( max-width: 480px ) {
	.novakey-account__licence {
		padding: 0.9rem 1rem;
	}

	/* Labels are short: keep two columns on a phone. */
	.novakey-account__facts {
		grid-template-columns: max-content 1fr;
		gap: 0.2rem 0.75rem;
	}
}
