/**
 * Subscription & Support Ticket System — Front-end styles
 * Palette: deep indigo primary (#d10000), slate body text (#374151),
 * warm amber accent for progress/CTA highlights (#D97A34), success green (#1F9D6B),
 * danger red (#C2433D), neutral surface (#F7F7FB).
 * Typeface: system UI stack (keeps the plugin dependency-free and consistent
 * with whatever theme it's dropped into).
 */

:root {
	--stms-ink:        #d10000;
	--stms-body:       #374151;
	--stms-muted:      #6B7280;
	--stms-accent:     #d10000;
	--stms-accent-dk:  #d10000;
	--stms-success:    #1F9D6B;
	--stms-danger:     #C2433D;
	--stms-warn-bg:    #FCF3E7;
	--stms-warn-bd:    #E9C08C;
	--stms-surface:    #F7F7FB;
	--stms-border:     #E3E4ED;
	--stms-radius:      10px;
	--stms-radius-sm:   6px;
	--stms-shadow:      0 1px 2px rgba(42,49,88,0.06), 0 6px 16px rgba(42,49,88,0.07);
	font-family: "Rubik", Sans-serif;
}

.stms-plan-page, .stms-dashboard, .stms-thankyou, .stms-myaccount-plan, .stms-myaccount-tickets {
	color: var(--stms-body);
	line-height: 1.5;
	max-width: 1080px;
	margin: 0 auto;
}

.stms-cart-popup__close:hover {
    color: #D10000;
}

.stms-cart-popup h3 {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px 0;
    color: #000000;
}

.stms-cart-popup__intro {
    font-size: 14px;
    color: #666666;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

.stms-cart-popup__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stms-plan-card--compact {
    border: 1px solid #000000;
    padding: 25px 20px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: border-color 0.2s ease;
}

.stms-plan-card--compact:hover {
    border-color: #D10000;
}

.stms-plan-card--compact h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
}

.stms-plan-card__tickets {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #D10000;
    margin-bottom: 12px;
}

.stms-plan-card__price {
    font-size: 24px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 20px;
}

.stms-plan-card__price span {
    font-size: 12px;
    font-weight: 400;
    color: #666666;
    text-transform: lowercase;
}

.stms-btn {
    font-family: "Rubik", sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid #000000;
    background: #000000;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
    box-sizing: border-box;
}

.stms-btn:hover {
    background: #D10000;
    border-color: #D10000;
    color: #ffffff;
}

.stms-cart-popup__footer {
    text-align: center;
    border-top: 1px dashed #000000;
    padding-top: 20px;
}

.stms-cart-popup__continue {
    background: none;
    border: none;
    font-family: "Rubik", sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666666;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: underline;
}

.stms-cart-popup__continue:hover {
    color: #000000;
}

@media (max-width: 550px) {
    .stms-cart-popup {
        padding: 25px 20px;
    }

    .stms-cart-popup__grid {
        grid-template-columns: 1fr;
    }
}

.stms-plan-page *, .stms-dashboard *, .stms-thankyou *, .stms-modal * {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------- buttons */
.stms-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: var(--stms-ink);
	color: #fff;
	border: none;
	border-radius: var(--stms-radius-sm);
	padding: 11px 20px;
	font-size: 14.5px;
	font-weight: 600;
	letter-spacing: 0.1px;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
.stms-btn:hover { background: #1f2547; box-shadow: 0 4px 10px rgba(42,49,88,0.25); }
.stms-btn:active { transform: translateY(1px); }
.stms-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.stms-btn--secondary { background: #fff; color: var(--stms-ink); border: 1px solid var(--stms-border); }
.stms-btn--secondary:hover { background: var(--stms-surface); box-shadow: none; }
.stms-btn--small { padding: 6px 12px; font-size: 13px; }
.stms-btn--large { padding: 14px 30px; font-size: 16px; }
.stms-btn--danger { background: var(--stms-danger); }
.stms-btn--danger:hover { background: #a3372f; }

/* ---------------------------------------------------------------- plan page */
.stms-plan-page__header { text-align: center; margin-bottom: 32px; }
.stms-plan-page__header h2 { color: var(--stms-ink); font-size: 28px; margin: 0 0 8px; }
.stms-plan-page__header p { color: var(--stms-muted); margin: 0; }

.stms-plan-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-bottom: 36px;
}
.stms-plan-grid--compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

.stms-plan-card {
	background: #fff;
	border: 1px solid var(--stms-border);
	border-radius: var(--stms-radius);
	padding: 24px;
	display: flex;
	flex-direction: column;
	box-shadow: var(--stms-shadow);
}
.stms-plan-card h3 { margin: 0 0 6px; color: var(--stms-ink); font-size: 19px; }
.stms-plan-card__desc { color: var(--stms-muted); font-size: 13.5px; margin: 0 0 14px; min-height: 18px; }
.stms-plan-card__price { font-size: 28px; font-weight: 700; color: var(--stms-ink); margin-bottom: 6px; }
.stms-plan-card__price span { font-size: 13px; font-weight: 500; color: var(--stms-muted); }
.stms-plan-card__tickets {
	display: inline-block;
	background: var(--stms-warn-bg);
	color: var(--stms-accent-dk);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 12.5px;
	font-weight: 600;
	margin-bottom: 14px;
	width: fit-content;
}
.stms-plan-card__features { list-style: none; margin: 0 0 20px; padding: 0; flex: 1; }
.stms-plan-card__features li {
	padding: 7px 0 7px 24px;
	border-top: 1px solid var(--stms-border);
	font-size: 13.5px;
	position: relative;
}
.stms-plan-card__features li:first-child { border-top: none; }
.stms-plan-card__features li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--stms-success);
	font-weight: 700;
}
.stms-plan-card .stms-btn { width: 100%; }

.stms-plan-card--compact { padding: 16px; }
.stms-plan-card--compact h4 { margin: 0 0 4px; color: var(--stms-ink); font-size: 15px; }
.stms-plan-card__price { font-size: 17px; }

.stms-comparison-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: var(--stms-radius);
	overflow: hidden;
	box-shadow: var(--stms-shadow);
}
.stms-comparison-table th, .stms-comparison-table td {
	padding: 12px 16px;
	text-align: center;
	border-bottom: 1px solid var(--stms-border);
	font-size: 13.5px;
}
.stms-comparison-table th { background: var(--stms-surface); color: var(--stms-ink); font-weight: 700; }
.stms-comparison-table td:first-child, .stms-comparison-table th:first-child { text-align: left; color: var(--stms-body); font-weight: 600; }

/* ---------------------------------------------------------------- cards / dashboard */
.stms-card {
	background: #fff;
	border: 1px solid var(--stms-border);
	border-radius: var(--stms-radius);
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: var(--stms-shadow);
}
.stms-card h2 { margin: 0 0 18px; font-size: 19px; color: var(--stms-ink); }

.stms-plan-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 16px;
	margin-bottom: 18px;
}
.stms-plan-summary > div { display: flex; flex-direction: column; gap: 4px; }
.stms-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--stms-muted); }

.stms-usage { margin-bottom: 18px; }
.stms-usage__labels { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; color: var(--stms-ink); margin-bottom: 8px; }
.stms-progress-bar { height: 10px; background: var(--stms-surface); border-radius: 999px; overflow: hidden; border: 1px solid var(--stms-border); }
.stms-progress-bar__fill { height: 100%; background: linear-gradient(90deg, var(--stms-accent), var(--stms-accent-dk)); border-radius: 999px; transition: width 0.4s ease; }

.stms-notice {
	border-radius: var(--stms-radius-sm);
	padding: 12px 16px;
	font-size: 13.5px;
	margin-bottom: 16px;
}
.stms-notice--warning { background: var(--stms-warn-bg); border: 1px solid var(--stms-warn-bd); color: var(--stms-accent-dk); }
.stms-notice--success { background: #E9F8F1; border: 1px solid #BCEBD4; color: var(--stms-success); }
.stms-notice--error { background: #FBEAE9; border: 1px solid #F0C2BF; color: var(--stms-danger); }

.stms-plan-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }

.stms-upgrade-options { margin-top: 22px; border-top: 1px solid var(--stms-border); padding-top: 18px; }
.stms-upgrade-options h3 { font-size: 15px; margin: 0 0 12px; color: var(--stms-ink); }

/* ---------------------------------------------------------------- ticket form */
.stms-ticket-form { display: grid; gap: 14px; }
.stms-ticket-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--stms-ink); }
.stms-ticket-form input[type="text"],
.stms-ticket-form input[type="file"],
.stms-ticket-form select,
.stms-ticket-form textarea {
	font: inherit;
	font-weight: 400;
	padding: 10px 12px;
	border: 1px solid var(--stms-border);
	border-radius: var(--stms-radius-sm);
	background: var(--stms-surface);
	color: var(--stms-body);
}
.stms-ticket-form textarea { resize: vertical; }
.stms-ticket-form input:focus, .stms-ticket-form select:focus, .stms-ticket-form textarea:focus {
	outline: 2px solid var(--stms-accent);
	outline-offset: 1px;
	background: #fff;
}
.stms-form-msg { font-size: 13px; font-weight: 600; min-height: 18px; }
.stms-form-msg--success { color: var(--stms-success); }
.stms-form-msg--error { color: var(--stms-danger); }

/* ---------------------------------------------------------------- tables / badges */
.stms-table { width: 100%; border-collapse: collapse; }
.stms-table th, .stms-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--stms-border); font-size: 13.5px; }
.stms-table th { color: var(--stms-muted); font-weight: 600; text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.3px; }

.stms-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: capitalize;
	background: var(--stms-surface);
	color: var(--stms-ink);
	border: 1px solid var(--stms-border);
}
.stms-badge--open, .stms-badge--active             { background: #E9F8F1; color: var(--stms-success); border-color: #BCEBD4; }
.stms-badge--pending, .stms-badge--trialing         { background: var(--stms-warn-bg); color: var(--stms-accent-dk); border-color: var(--stms-warn-bd); }
.stms-badge--in_progress                            { background: #EAF1FB; color: #2B5FA8; border-color: #C8DBF4; }
.stms-badge--waiting_customer, .stms-badge--paused  { background: #F1ECFB; color: #6B3FB0; border-color: #D9CBF1; }
.stms-badge--resolved                               { background: #E9F8F1; color: var(--stms-success); border-color: #BCEBD4; }
.stms-badge--closed, .stms-badge--cancelled         { background: #ECECF1; color: var(--stms-muted); border-color: var(--stms-border); }
.stms-badge--past_due, .stms-badge--incomplete      { background: #FBEAE9; color: var(--stms-danger); border-color: #F0C2BF; }

/* ---------------------------------------------------------------- modal */
.stms-modal { position: fixed; inset: 0; z-index: 100000; }
.stms-modal[hidden] { display: none; }
.stms-modal__backdrop { position: absolute; inset: 0; background: rgba(42,49,88,0.45); }
.stms-modal__panel {
	position: relative;
	background: #fff;
	max-width: 560px;
	margin: 6vh auto;
	border-radius: var(--stms-radius);
	padding: 28px;
	max-height: 84vh;
	overflow-y: auto;
	box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.stms-modal__close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: var(--stms-muted);
}
.stms-modal__title { margin: 0 0 16px; padding-right: 28px; color: var(--stms-ink); }
.stms-modal__thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; max-height: 320px; overflow-y: auto; }
.stms-modal__msg { border-radius: var(--stms-radius-sm); padding: 10px 14px; font-size: 13.5px; background: var(--stms-surface); }
.stms-modal__msg--admin { background: #EAF1FB; align-self: flex-start; }
.stms-modal__msg--customer { background: var(--stms-warn-bg); align-self: flex-end; }
.stms-modal__msg-meta { font-size: 11px; color: var(--stms-muted); margin-bottom: 4px; font-weight: 600; }
.stms-reply-form { display: grid; gap: 10px; }
.stms-reply-form textarea {
	font: inherit; padding: 10px 12px; border: 1px solid var(--stms-border);
	border-radius: var(--stms-radius-sm); background: var(--stms-surface); resize: vertical;
}
.stms-modal__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------------------------------------------------------- cart popup */
.stms-cart-popup__backdrop { position: fixed; inset: 0; background: rgba(42,49,88,0.5); z-index: 100050; }
.stms-cart-popup {
	position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
	background: #fff; border-radius: var(--stms-radius); padding: 28px; width: 92%; max-width: 640px;
	z-index: 100051; box-shadow: 0 24px 60px rgba(0,0,0,0.3); max-height: 86vh; overflow-y: auto;
}
.stms-cart-popup__close { position: absolute; top: 14px; right: 18px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--stms-muted); }
.stms-cart-popup h3 { margin: 0 0 6px; color: var(--stms-ink); font-size: 19px; }
.stms-cart-popup p.stms-cart-popup__intro { color: var(--stms-muted); margin: 0 0 18px; font-size: 13.5px; }
.stms-cart-popup__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; margin-bottom: 16px; }
.stms-cart-popup__footer { text-align: center; }
.stms-cart-popup__continue { background: none; border: none; color: var(--stms-muted); font-size: 13px; text-decoration: underline; cursor: pointer; }

/* ---------------------------------------------------------------- cart-page subscribe banner */
.stms-cart-banner {
	background: #fff;
	border: 1px solid var(--stms-border);
	border-left: 4px solid var(--stms-ink);
	border-radius: var(--stms-radius);
	padding: 20px 22px;
	margin-bottom: 22px;
	box-shadow: var(--stms-shadow);
}
.stms-cart-banner h3 { margin: 0 0 6px; color: var(--stms-ink); font-size: 17px; }
.stms-cart-banner p { margin: 0 0 16px; color: var(--stms-muted); font-size: 13.5px; }
.stms-cart-banner__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }

/* ---------------------------------------------------------------- thank you */
.stms-thankyou { text-align: center; padding: 50px 20px; max-width: 480px; }
.stms-thankyou__check { margin: 0 auto 20px; }
.stms-thankyou__circle {
	stroke: var(--stms-success);
	stroke-dasharray: 226;
	stroke-dashoffset: 226;
	animation: stms-draw-circle 0.6s ease forwards;
}
.stms-thankyou__tick {
	stroke: var(--stms-success);
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: stms-draw-tick 0.4s ease forwards 0.55s;
}
@keyframes stms-draw-circle { to { stroke-dashoffset: 0; } }
@keyframes stms-draw-tick   { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
	.stms-thankyou__circle, .stms-thankyou__tick { animation: none; stroke-dashoffset: 0; }
}
.stms-thankyou h1 { color: var(--stms-ink); font-size: 26px; margin: 0 0 6px; }
.stms-thankyou__sub { color: var(--stms-muted); margin: 0 0 24px; }
.stms-thankyou__card {
	background: #fff; border: 1px solid var(--stms-border); border-radius: var(--stms-radius);
	padding: 20px 24px; margin-bottom: 28px; text-align: left; box-shadow: var(--stms-shadow);
}
.stms-thankyou__row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--stms-border); font-size: 14px; }
.stms-thankyou__row:last-child { border-bottom: none; }
.stms-thankyou__row span { color: var(--stms-muted); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
	.stms-plan-grid, .stms-plan-summary { grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); }
}
@media (max-width: 600px) {
	.stms-plan-page, .stms-dashboard { padding: 0 4px; }
	.stms-card, .stms-plan-card, .stms-thankyou__card { padding: 18px; }
	.stms-comparison-table { font-size: 12px; display: block; overflow-x: auto; white-space: nowrap; }
	.stms-plan-actions { flex-direction: column; }
	.stms-plan-actions .stms-btn { width: 100%; }
	.stms-modal__panel { margin: 4vh 12px; padding: 20px; }
	.stms-cart-popup { padding: 20px; }
	.stms-thankyou { padding: 32px 16px; }
}

/* =========================================================================
 * v1.1 - Support Plan add-on selector (Cart + Checkout pages)
 * ======================================================================= */
.stms-addon {
	font-family: 'Rubik', sans-serif;
	border: 2px solid #000000;
	background: #ffffff;
	padding: 26px 24px;
	margin: 28px 0;
	clear: both;
}
.stms-addon.is-busy { opacity: 0.55; pointer-events: none; }
.stms-addon__head h3 {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #000000;
}
.stms-addon__head h3 span {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 1px;
	color: #ffffff;
	background: #D10000;
	padding: 3px 8px;
	vertical-align: middle;
	margin-left: 8px;
}
.stms-addon__head p {
	margin: 0 0 18px;
	font-size: 13px;
	color: #666666;
	line-height: 1.5;
}
.stms-addon__options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 12px;
}
.stms-addon__option {
	display: flex;
	flex-direction: column;
	gap: 4px;
	border: 1px solid #d1d5db;
	padding: 16px 14px;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	background: #ffffff;
	margin: 0;
}
.stms-addon__option:hover { border-color: #000000; }
.stms-addon__option.is-selected {
	border: 2px solid #D10000;
	box-shadow: 0 0 0 1px #D10000 inset;
	padding: 15px 13px;
}
.stms-addon__option input { position: absolute; opacity: 0; pointer-events: none; }
.stms-addon__option-name {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	color: #000000;
}
.stms-addon__option-price {
	font-size: 18px;
	font-weight: 700;
	color: #000000;
}
.stms-addon__option-price em {
	font-style: normal;
	font-size: 11px;
	font-weight: 400;
	color: #666666;
}
.stms-addon__option-desc { font-size: 11px; color: #666666; }
.stms-addon__note {
	margin: 16px 0 0;
	font-size: 11.5px;
	color: #888888;
	border-top: 1px dashed #d1d5db;
	padding-top: 12px;
}
.stms-cart-item-cycle { color: #888888; font-size: 11px; }
@media (max-width: 560px) {
	.stms-addon__options { grid-template-columns: 1fr; }
}
