/**
 * TPS License Manager - support subscription product page and renewal choice at checkout
 */

/* The ordinary add-to-cart cannot be used: a subscription has to be attached
   to a licence, which is what the selector below is for. */
.tps-subscription-wrapper ~ .single_add_to_cart_button,
form.cart .single_add_to_cart_button {
    display: none !important;
}

.tps-subscription-wrapper {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.tps-license-selector { margin-bottom: 15px; }

.tps-license-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.tps-license-selector select {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.tps-license-selector select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, .2);
}

.tps-catchup-preview {
    background: #fff8e6;
    border: 1px solid #f0c36d;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 15px;
    display: none;
}

.tps-catchup-preview p { margin: 0; font-size: 14px; color: #856404; }
.tps-catchup-preview strong { color: #664d03; }

.tps-button-wrapper { margin-top: 15px; }
.tps-button-row { display: flex; gap: 10px; }
.tps-button-row .tps-button { flex: 1; }

.tps-button {
    display: block;
    width: 100%;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color .2s, opacity .2s;
}

.tps-button-primary { background: #2e7d32; color: #fff; }
.tps-button-primary:hover { background: #256329; color: #fff; }

.tps-button-primary:disabled,
.tps-button-primary.disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

a.tps-button-primary,
a.tps-button-primary:visited,
a.tps-button-primary:hover,
a.tps-button-primary:active { color: #fff !important; }

.tps-notice {
    padding: 12px 15px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #555;
    font-size: 14px;
}

.tps-notice a { color: #2e7d32; font-weight: 500; }
.tps-notice a:hover { text-decoration: underline; }

/* SUMO prints its own sync date on the product page, which contradicts the
   date this plugin works out. */
#sumosubs_initial_synced_payment_date { display: none !important; }

/* Renewal choice at checkout
   ------------------------------------------------------------------ */

.tps-renewal-optin {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 1em;
}

.tps-renewal-optin h3 {
    margin: 0 0 4px;
    font-size: 1em;
}

.tps-renewal-optin p {
    margin: 0 0 10px;
    font-size: .85em;
    color: #666;
}

.tps-renewal-optin select {
    width: 100%;
    padding: 8px 10px;
}

.tps-renewal-optin p.tps-renewal-manual-only {
    margin: 0;
    font-size: .9em;
    color: #333;
}

.tps-renewal-optin select.tps-error {
    border-color: #e2401c;
    box-shadow: 0 0 0 1px #e2401c;
}

.tps-renewal-optin-error {
    margin-top: 8px;
    font-size: .8em;
    color: #e2401c;
}

/* Unanswered: the button still works, so a customer who gets past the
   script is stopped by the server, not by a dead control. */
#place_order.tps-awaiting-choice {
    opacity: .55;
}

/* SUMO's own switcher asks the same question in its own words. */
.sumosubs_payment_mode_switcher {
    display: none !important;
}