/*
 * Prescription upload widget.
 *
 * Replaces the inline CSS that `cst_fld_upld_inline_css()` printed into wp_head
 * on every page of the site. That block carried twelve off-palette colour values,
 * including the old brand green #68943e, the old brand blue #517182, a WordPress
 * admin blue #007cba, and greys at #333, #666 and #d3d3d3. Acceptance criterion 3
 * measures rendered computed styles, so twelve violations on every URL was not
 * something to leave for later.
 *
 * The selectors are kept exactly as the widget's markup expects them, including
 * the ID selectors, because the markup is generated by fms-core and is out of
 * scope to change. Only the values are ours.
 */

.cstm-prd-upload-wrapper {
	width: 100%;
}

.cstm-prd-upload-wrapper .upload-prescription-header label {
	display: block;
	margin-bottom: 10px;
	font-weight: var(--fms-weight-medium);
	font-size: var(--fms-size-meta);
	color: var(--fms-ink);
}

.cstm-prd-upload-wrapper .fld-desc {
	display: flex;
	align-items: center;
	justify-content: center;
	column-gap: 10px;
	font-size: var(--fms-size-meta);
	line-height: 24px;
	color: var(--fms-muted);
}

.cstm-prd-upload-wrapper .fld-desc .fld-icn {
	display: flex;
}

/* The drop zone. Dashed border in the design's own hairline colour, on sage. */
.cstm-prd-upload-wrapper #dropArea,
#dropArea {
	max-width: 100%;
	padding: 20px;
	border: 2px dashed var(--fms-border);
	border-radius: var(--fms-radius-card);
	background: var(--fms-sage);
	text-align: center;
	cursor: pointer;
	transition: border-color var(--fms-transition), background var(--fms-transition);
}

.cstm-prd-upload-wrapper #dropArea:hover,
#dropArea:hover {
	border-color: var(--fms-brass);
}

/* Drag over. Brass, because brass is the accent that means "this is active". */
#dropArea.dragover {
	border-color: var(--fms-brass);
	background: var(--fms-cream);
}

.cstm-prd-upload-wrapper #selectFileBtn,
#selectFileBtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: var(--fms-tap-min);
	padding: 11px 24px;
	border: 0;
	border-radius: var(--fms-radius-pill);
	background: var(--fms-forest);
	color: var(--fms-cream);
	font-family: var(--fms-font-body);
	font-weight: var(--fms-weight-medium);
	font-size: var(--fms-size-meta);
	cursor: pointer;
	transition: background var(--fms-transition);
}

.cstm-prd-upload-wrapper #selectFileBtn:hover {
	background: linear-gradient(var(--fms-shade-22), var(--fms-shade-22)), var(--fms-forest);
	color: var(--fms-white);
}

.cstm-prd-upload-wrapper #selectFileBtn:disabled {
	background: var(--fms-muted);
	color: var(--fms-cream);
	cursor: not-allowed;
}

/* The uploaded file panel. A card, like every other panel in the design. */
.cstm-prd-upload-wrapper .uploaded-file-info,
.uploaded-file-info {
	margin-top: 20px;
	padding: 14px 16px;
	border-left: 4px solid var(--fms-brass);
	border-radius: 0 var(--fms-radius-card) var(--fms-radius-card) 0;
	background: var(--fms-white);
	box-shadow: var(--fms-shadow-card);
}

.cstm-prd-upload-wrapper #fileName {
	margin: 0;
	font-weight: var(--fms-weight-medium);
	font-size: var(--fms-size-meta);
	color: var(--fms-ink);
}

/*
 * Remove. The original used a red tint here, and the palette has no red. The
 * control is destructive, so it must not rely on colour alone to say so: it
 * carries its own label and, on hover, the muted ground that every disabled or
 * receding element in this design uses.
 */
.remove-file-btn {
	min-height: var(--fms-tap-min);
	padding: 6px 14px;
	border: 1px solid var(--fms-border);
	border-radius: var(--fms-radius-pill);
	background: transparent;
	color: var(--fms-muted);
	font-size: var(--fms-size-small);
	cursor: pointer;
	transition: background var(--fms-transition), color var(--fms-transition);
}

.remove-file-btn:hover {
	background: var(--fms-muted);
	border-color: var(--fms-muted);
	color: var(--fms-cream);
}

/* Prescription note against a cart line item. */
.woocommerce-cart-form__cart-item .prescription-info {
	display: block;
	margin-top: 6px;
	font-size: var(--fms-size-small);
	color: var(--fms-muted);
}
