/**
 * "I miei documenti" inside the WooCommerce account area.
 *
 * WooCommerce gives an endpoint a bare container and nothing else, so every
 * part of this screen has to claim its own look. It claims it the way
 * `certificate.css` already does on the checkout: colours and radii come from
 * the active theme's custom properties with fallbacks close to them, so the
 * screen follows the Fruscio theme where there is one and still reads as
 * deliberate under any other.
 *
 * One rule earns its place over taste: the state of a document is the first
 * thing a rider is looking for, so it is a coloured chip on the left of the
 * row and not a word inside the text.
 */

.fr-doc-intro {
	max-width: 56ch;
	margin: 0 0 24px;
	color: var(--fr-muted, #5a5a55);
}

/* ── The filed documents ─────────────────────────────────── */

.fr-doc-list {
	margin: 0 0 40px;
	padding: 0;
	list-style: none;
}

.fr-doc {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px 16px;
	padding: 16px 0;
	border-top: 1px solid var(--fr-line, #e2e2df);
}

.fr-doc:last-child {
	border-bottom: 1px solid var(--fr-line, #e2e2df);
}

.fr-doc__body {
	flex: 1 1 220px;
}

.fr-doc__title {
	margin: 0 0 2px;
	font-weight: 600;
	color: var(--fr-ink, #1b1b1b);
}

.fr-doc__facts {
	margin: 0;
	font-size: 14px;
	color: var(--fr-muted, #5a5a55);
}

/* Why a document came back. It is the only sentence on this screen a rider
   has to act on, so it is set apart rather than appended to the facts. */
.fr-doc__note {
	margin: 8px 0 0;
	padding-left: 12px;
	border-left: 2px solid var(--fr-line, #e2e2df);
	font-size: 14px;
	color: var(--fr-ink, #1b1b1b);
}

.fr-doc__state {
	flex: 0 0 auto;
	padding: 4px 12px;
	border-radius: var(--fr-r-pill, 999px);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
}

.fr-doc__state--pending {
	background: var(--fr-sand, #f0ead8);
	color: var(--fr-ink, #1b1b1b);
}

.fr-doc__state--valid {
	background: var(--fr-green, #693);
	color: #fff;
}

.fr-doc__state--rejected,
.fr-doc__state--expired {
	background: #8c2f2f;
	color: #fff;
}

.fr-doc__actions {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 16px;
	font-size: 14px;
}

.fr-doc__actions form {
	margin: 0;
}

.fr-doc__remove {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: var(--fr-muted, #5a5a55);
	text-decoration: underline;
	cursor: pointer;
}

.fr-doc__remove:hover,
.fr-doc__remove:focus {
	color: #8c2f2f;
}

.fr-doc-empty {
	margin: 0 0 40px;
	color: var(--fr-muted, #5a5a55);
}

/* ── The upload form ─────────────────────────────────────── */

.fr-doc-form {
	max-width: 480px;
	padding: 24px;
	border: 1px solid var(--fr-line, #e2e2df);
	border-radius: var(--fr-r-md, 16px);
	background: var(--fr-card, #fbfaf6);
}

/* Two classes: a theme's content headings (.fr-entry h3 on Fruscio) would
   otherwise outrank this and blow the title up to an article heading. */
.fr-doc-form .fr-doc-form__title {
	margin: 0 0 20px;
	font-size: 18px;
	line-height: 1.25;
}

/* With the room of a full account column the four fields pair up, two by
   two, instead of a 480px stack beside an empty half. */
@media (min-width: 720px) {

	.fr-doc-form {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0 24px;
		max-width: 880px;
		padding: 28px;
	}

	.fr-doc-form > * {
		min-width: 0;
		margin-top: 0;
	}

	.fr-doc-form .fr-doc-form__title,
	.fr-doc-form .fr-doc-form__submit {
		grid-column: 1 / -1;
	}

	.fr-doc-form .fr-doc-form__submit {
		justify-self: start;
	}
}

.fr-doc-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 18px;
}

.fr-doc-field label {
	font-size: 14px;
	font-weight: 600;
	color: var(--fr-ink, #1b1b1b);
}

.fr-doc-field select,
.fr-doc-field input[type="date"],
.fr-doc-field input[type="file"] {
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border: 1px solid var(--fr-line, #e2e2df);
	border-radius: var(--fr-r-sm, 8px);
	background: var(--fr-white, #fff);
	font-family: inherit;
	font-size: 15px;
	color: var(--fr-ink, #1b1b1b);
}

.fr-doc-field input[type="file"] {
	line-height: 46px;
	cursor: pointer;
}

.fr-doc-field input[type="file"]::file-selector-button {
	margin-right: 12px;
	padding: 7px 16px;
	border: 0;
	border-radius: var(--fr-r-pill, 999px);
	background: var(--fr-ink, #1b1b1b);
	font: inherit;
	font-size: 14px;
	color: #fff;
	cursor: pointer;
}

.fr-doc-hint {
	font-size: 13px;
	color: var(--fr-muted, #5a5a55);
}

/* The complaint sits under the field it is about, so there is never a doubt
   about which one to fix. */
.fr-doc-error {
	font-size: 13px;
	font-weight: 600;
	color: #8c2f2f;
}

.fr-doc-form__submit {
	min-height: 48px;
	padding: 0 28px;
	border: 0;
	border-radius: var(--fr-r-pill, 999px);
	background: var(--fr-green, #693);
	font: inherit;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
}

.fr-doc-form__submit:hover,
.fr-doc-form__submit:focus {
	background: var(--fr-navy, #036);
}

/* ── What just happened ──────────────────────────────────── */

.fr-doc-notice {
	margin: 0 0 24px;
	padding: 14px 18px;
	border-radius: var(--fr-r-sm, 8px);
	border-left: 4px solid transparent;
}

.fr-doc-notice--success {
	border-left-color: var(--fr-green, #693);
	background: var(--fr-sage, #eef2e8);
}

.fr-doc-notice--error {
	border-left-color: #8c2f2f;
	background: #f6e9e9;
}

/* ── Le iscrizioni dentro un ordine ──────────────────────── */

/* The panel renders on the customer's order page and on the order screen in
   wp-admin, where none of the theme's custom properties exist. Every fallback
   below therefore has to stand on its own. */

.fr-reg {
	margin: 32px 0 0;
}

.fr-reg__title {
	margin: 0 0 12px;
	font-size: 16px;
}

.fr-reg__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.fr-reg__line {
	display: grid;
	gap: 2px;
	padding: 12px 0 12px 14px;
	border-left: 4px solid var(--fr-line, #e2e2df);
}

.fr-reg__line + .fr-reg__line {
	border-top: 1px solid var(--fr-line, #e2e2df);
}

/* The colour is the whole point of the strip: a rider scanning three orders
   should not have to read three sentences to find the one that needs them. */
.fr-reg__line--ok {
	border-left-color: var(--fr-green, #693);
}

.fr-reg__line--pending,
.fr-reg__line--undated {
	border-left-color: #c8a227;
}

.fr-reg__line--missing,
.fr-reg__line--expired,
.fr-reg__line--insufficient,
.fr-reg__line--rejected {
	border-left-color: #8c2f2f;
}

.fr-reg__event {
	font-weight: 600;
	color: var(--fr-ink, #1b1b1b);
}

.fr-reg__routes {
	font-size: 14px;
	color: var(--fr-muted, #5a5a55);
}

.fr-reg__verdict {
	font-size: 14px;
}

.fr-reg__cta {
	margin: 12px 0 0;
	font-size: 14px;
}

/* ── La conferma da portare al ritiro pacco ──────────────── */

.fr-reg__list--account .fr-reg__line {
	padding-top: 16px;
	padding-bottom: 16px;
}

.fr-reg__actions {
	margin-top: 4px;
	font-size: 14px;
}

.fr-conf {
	max-width: 560px;
	padding: 28px;
	border: 1px solid var(--fr-line, #e2e2df);
	border-radius: var(--fr-r-md, 16px);
	background: var(--fr-white, #fff);
}

.fr-conf__meta {
	margin: 0;
	font-size: 14px;
	color: var(--fr-muted, #5a5a55);
}

.fr-conf__rider {
	margin: 2px 0 20px;
	font-size: 22px;
	font-weight: 600;
	color: var(--fr-ink, #1b1b1b);
}

.fr-conf__note {
	margin: 20px 0 0;
	font-size: 14px;
	color: var(--fr-muted, #5a5a55);
}

.fr-conf__actions {
	display: flex;
	align-items: center;
	gap: 20px;
	margin: 24px 0 0;
}

/* On paper the confirmation is the only thing on the page. The account
   navigation and the print button itself are the two that would otherwise
   always come along; the rest is the theme's business. */
@media print {

	.fr-header,
	.fr-footer,
	.woocommerce-MyAccount-navigation,
	.fr-print-hide {
		display: none !important;
	}

	.fr-conf {
		max-width: none;
		padding: 0;
		border: 0;
	}
}
