/* =========================================================================
 * DriveCrate Subscription Controls — the subscription card and dialogs.
 *
 * Neutral on its own; the My Account design (account.css) restyles it in
 * the DriveCrate look. To match another brand, override the custom
 * properties below from the theme's stylesheet.
 * ====================================================================== */
:root {
	--dcsc-accent: #111111;
	--dcsc-accent-dark: #000000;
	--dcsc-danger: #c62828;
	--dcsc-ink: #16161a;
	--dcsc-muted: #6b6b70;
	--dcsc-line: #e3e3e6;
	--dcsc-surface: #fafafa;
	--dcsc-radius: 14px;
}

/* -------------------------------------------------------------------------
 * Card
 * ---------------------------------------------------------------------- */
.dcsc-cards { display: grid; gap: 24px; }

.dcsc-card {
	margin: 0 0 28px;
	padding: 24px;
	border: 1.5px solid var(--dcsc-line);
	border-radius: var(--dcsc-radius);
	background: #fff;
	color: var(--dcsc-ink);
	scroll-margin-top: 110px;
}
.dcsc-cards .dcsc-card { margin: 0; }
.dcsc-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px 16px;
	margin: 0 0 16px;
}
.dcsc-card__plan { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--dcsc-muted); }
.dcsc-card .dcsc-card__title { margin: 0; font-size: 22px; line-height: 1.2; }

.dcsc-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	flex: 0 0 auto;
	padding: 4px 11px;
	border-radius: 999px;
	background: var(--dcsc-surface);
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.35;
	white-space: nowrap;
	color: var(--dcsc-muted);
}
.dcsc-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dcsc-chip--live { background: #e3f7e9; color: #1d6b3a; }
.dcsc-chip--warn { background: #fff3d6; color: #6b4d00; }

.dcsc-card__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
	margin: 0 0 18px;
}
.dcsc-card__facts > div { padding: 12px 14px; border-radius: 12px; background: var(--dcsc-surface); }
.dcsc-card__facts dt { margin: 0 0 2px; font-size: 12.5px; font-weight: 600; color: var(--dcsc-muted); }
.dcsc-card__facts dd { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }

.dcsc-card__skips { margin: 0 0 16px; padding: 0; list-style: none; }
.dcsc-card__skips li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 6px;
	padding: 8px 12px;
	border: 1.5px dashed var(--dcsc-line);
	border-radius: 10px;
	font-size: 14px;
	list-style: none;
}
.dcsc-card__skips li::before { content: none; }
.dcsc-card__skips form { margin: 0; }

/* Four equal-weight controls: nothing hidden behind a menu. */
.dcsc-card__actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 10px;
}
.dcsc-card__actions > form,
.dcsc-card__actions > .dcsc-btn { margin: 0; }
.dcsc-card__actions .dcsc-btn { width: 100%; }

.dcsc-card__links { margin: 14px 0 0; font-size: 14px; color: var(--dcsc-muted); }
.dcsc-card__links span { margin: 0 8px; }
.dcsc-card__link { font-weight: 600; }

.dcsc-alert {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 0 16px;
	padding: 12px 14px;
	border-left: 4px solid var(--dcsc-muted);
	border-radius: 10px;
	background: var(--dcsc-surface);
	color: var(--dcsc-ink);
	font-size: 15px;
}
.dcsc-alert--ok     { border-left-color: #2e9d5b; background: #eefaf2; }
.dcsc-alert--error  { border-left-color: var(--dcsc-danger); background: #fdecec; }
.dcsc-alert--paused { border-left-color: #d39a00; background: #fff8e6; }

.dcsc-ended { margin-top: 8px; }
.dcsc-ended__title { margin: 0 0 10px; font-size: 16px; }
.dcsc-ended__list { margin: 0; padding: 0; list-style: none; }
.dcsc-ended__list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--dcsc-line); list-style: none; }
.dcsc-ended__list li::before { content: none; }
.dcsc-ended__num { margin-left: 6px; color: var(--dcsc-muted); font-weight: 500; }

/* -------------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------------- */
.dcsc-card .dcsc-btn,
.dcsc-modal .dcsc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 11px 18px;
	border: 1.5px solid var(--dcsc-accent);
	border-radius: 10px;
	background: var(--dcsc-accent);
	box-sizing: border-box;
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.dcsc-card .dcsc-btn:hover,
.dcsc-modal .dcsc-btn:hover { background: var(--dcsc-accent-dark); border-color: var(--dcsc-accent-dark); color: #fff; }
.dcsc-card .dcsc-btn:focus-visible,
.dcsc-modal .dcsc-btn:focus-visible { outline: 2px solid var(--dcsc-accent); outline-offset: 2px; }
.dcsc-card .dcsc-btn.is-busy,
.dcsc-modal.is-busy .dcsc-btn { opacity: .6; pointer-events: none; }

.dcsc-card .dcsc-btn--ghost,
.dcsc-modal .dcsc-btn--ghost { border-color: var(--dcsc-line); background: #fff; color: var(--dcsc-ink); }
.dcsc-card .dcsc-btn--ghost:hover,
.dcsc-modal .dcsc-btn--ghost:hover { border-color: var(--dcsc-ink); background: #fff; color: var(--dcsc-ink); }
.dcsc-card .dcsc-btn--danger { border-color: var(--dcsc-line); background: #fff; color: var(--dcsc-danger); }
.dcsc-card .dcsc-btn--danger:hover { border-color: var(--dcsc-danger); background: #fff; color: var(--dcsc-danger); }
.dcsc-modal .dcsc-btn--danger-solid,
.dcsc-modal .dcsc-btn--danger-solid:hover { border-color: var(--dcsc-danger); background: var(--dcsc-danger); color: #fff; }
.dcsc-card .dcsc-btn--link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--dcsc-accent);
	font-size: 14px;
	text-decoration: underline;
}
.dcsc-card .dcsc-btn--link:hover { background: none; color: var(--dcsc-ink); }

/* Locked until the first order completes. A span, so nothing to click, but
   still hoverable and focusable for the tooltip. */
.dcsc-card .dcsc-btn.is-locked,
.dcsc-card .dcsc-btn.is-locked:hover { opacity: .45; cursor: not-allowed; user-select: none; border-color: var(--dcsc-line); background: #fff; color: var(--dcsc-ink); }

/* -------------------------------------------------------------------------
 * Tooltip
 * ---------------------------------------------------------------------- */
.dcsc-tooltip {
	position: fixed; z-index: 100000; display: none;
	max-width: 260px; padding: 9px 12px; border-radius: 8px;
	background: var(--dcsc-ink); color: #fff;
	font-size: 13px; line-height: 1.45; font-weight: 500;
	box-shadow: 0 10px 30px rgba(0,0,0,.25);
	pointer-events: none;
}

/* -------------------------------------------------------------------------
 * Dialogs
 * ---------------------------------------------------------------------- */
.dcsc-modal {
	position: fixed; inset: 0; z-index: 99999;
	display: flex; align-items: center; justify-content: center; padding: 16px;
}
.dcsc-modal[hidden] { display: none; }
.dcsc-modal__backdrop { position: absolute; inset: 0; background: rgba(10,10,10,.6); animation: dcsc-fade .18s ease both; }
.dcsc-modal__box {
	position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
	padding: 30px 26px 24px; border-radius: 20px; box-sizing: border-box;
	background: #fff; color: var(--dcsc-ink);
	box-shadow: 0 24px 60px rgba(0,0,0,.3);
	animation: dcsc-pop .22s cubic-bezier(.2,.9,.3,1.3) both;
}
.dcsc-modal--small .dcsc-modal__box { max-width: 460px; }
.dcsc-modal .dcsc-modal__x {
	position: absolute; top: 10px; right: 10px; z-index: 2;
	display: flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
	background: none; box-shadow: none; color: #8a8a8a; cursor: pointer;
}
.dcsc-modal .dcsc-modal__x:hover { background: #f2f2f2; color: var(--dcsc-ink); }
.dcsc-modal .dcsc-modal__x svg { display: block; }
.dcsc-modal .dcsc-modal__title { margin: 0 36px 8px 0; font-size: 1.35em; line-height: 1.2; }
.dcsc-modal .dcsc-modal__title:focus { outline: none; }
.dcsc-modal .dcsc-modal__lede { margin: 0 0 18px; line-height: 1.5; color: #555; }
.dcsc-modal__step { animation: dcsc-slide .2s ease both; }
.dcsc-modal__step[hidden] { display: none; }
.dcsc-modal__step--done { text-align: center; }
.dcsc-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dcsc-modal__actions > form { margin: 0; }
.dcsc-modal__actions--stack { flex-direction: column; }
.dcsc-modal__actions--stack > .dcsc-btn,
.dcsc-modal__actions--stack > form,
.dcsc-modal__actions--stack > form .dcsc-btn { width: 100%; }
.dcsc-modal__step--done .dcsc-modal__actions { justify-content: center; }
.dcsc-modal__foot {
	display: flex; justify-content: space-between; align-items: center; gap: 8px;
	margin-top: 18px; padding-top: 14px; border-top: 1px solid #eee;
}
.dcsc-modal .dcsc-modal__back,
.dcsc-modal .dcsc-modal__decline {
	padding: 8px 4px; border: 0; background: none; box-shadow: none;
	font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: #555;
}
.dcsc-modal .dcsc-modal__back:hover { background: none; color: var(--dcsc-ink); }
/* "Continue to cancel" is always visible — plain, but never hidden. */
.dcsc-modal .dcsc-modal__decline { margin-left: auto; text-decoration: underline; text-underline-offset: 3px; }
.dcsc-modal .dcsc-modal__decline:hover { background: none; color: var(--dcsc-danger); }
.dcsc-modal .dcsc-modal__text {
	width: 100%; margin: 0 0 14px; padding: 12px; box-sizing: border-box;
	border: 1.5px solid #dcdcdc; border-radius: 10px;
	font: inherit; font-size: 15px; resize: vertical;
}
.dcsc-modal__error { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #fdecea; color: #b32d2e; font-size: 14px; }
.dcsc-modal__error[hidden] { display: none; }
.dcsc-modal.is-busy .dcsc-modal__box { cursor: progress; }

.dcsc-reasons { display: flex; flex-direction: column; gap: 8px; }
.dcsc-modal .dcsc-reason {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	width: 100%; margin: 0; padding: 13px 16px;
	border: 1.5px solid #e6e6e6; border-radius: 12px;
	background: #fff; color: var(--dcsc-ink); box-shadow: none;
	font: inherit; font-size: 15px; font-weight: 600; text-align: left; text-transform: none;
	cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.dcsc-modal .dcsc-reason:hover { border-color: var(--dcsc-ink); background: var(--dcsc-surface); color: var(--dcsc-ink); }
.dcsc-reason__go { font-weight: 700; }

/* What cancelling means — has to be unmissable. */
.dcsc-callout { margin: 0 0 16px; padding: 16px 18px; border-radius: 14px; background: var(--dcsc-surface); border: 1.5px solid var(--dcsc-line); }
.dcsc-callout p { margin: 0; line-height: 1.5; }
.dcsc-callout .dcsc-callout__big { margin: 0 0 4px; font-size: 19px; font-weight: 700; line-height: 1.25; }

.dcsc-anim { display: flex; align-items: center; justify-content: center; height: 90px; margin-bottom: 6px; color: #1f9d55; }
.dcsc-anim svg { width: 76px; height: 76px; }
.dcsc-anim__ring { stroke-dasharray: 166; stroke-dashoffset: 166; animation: dcsc-draw .45s ease-out forwards; }
.dcsc-anim__check { stroke-dasharray: 48; stroke-dashoffset: 48; animation: dcsc-draw .3s .38s ease-out forwards; }

@keyframes dcsc-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes dcsc-pop { from { opacity: 0; transform: translateY(14px) scale(.97) } to { opacity: 1; transform: none } }
@keyframes dcsc-slide { from { opacity: 0; transform: translateX(10px) } to { opacity: 1; transform: none } }
@keyframes dcsc-draw { to { stroke-dashoffset: 0 } }

@media (prefers-reduced-motion: reduce) {
	.dcsc-modal__backdrop, .dcsc-modal__box, .dcsc-modal__step { animation: none !important; }
	.dcsc-anim__ring, .dcsc-anim__check { stroke-dashoffset: 0; animation: none !important; }
}

@media (max-width: 560px) {
	.dcsc-card { padding: 18px; }
	.dcsc-card__actions { grid-template-columns: minmax(0, 1fr); }
	/* Phones: the dialog becomes a sheet from the bottom. */
	.dcsc-modal { align-items: flex-end; padding: 0; }
	.dcsc-modal__box { max-width: none; max-height: 94vh; padding: 26px 18px 22px; border-radius: 20px 20px 0 0; }
	.dcsc-modal .dcsc-modal__actions .dcsc-btn { width: 100%; }
	.dcsc-modal__actions > form { width: 100%; }
}

/* The credit being given up by cancelling — shown on the confirm screen. */
.dcsc-credit-warning {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 16px;
	padding: 11px 14px;
	border-radius: 14px;
	background: #fff6db;
	border: 1px solid #ffc53d;
	font-size: 14px;
	line-height: 1.45;
	color: #4a3a05;
}
.dcsc-credit-warning__icon {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffc53d;
	color: #4a3a05;
	font-weight: 800;
	font-size: 13px;
}
