/*
 * ==========================================================
 * LICENSE ADMIN.CSS
 * ==========================================================
 *
 * Styles for the Fluidpay subscription area (apps/license/admin.js).
 *
 */

.sb-license-box {
    max-width: 640px;
    margin-top: 15px;
}

/* Status card */
.sb-license-status {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 10px;
    background: #f6f7f9;
    border: 1px solid #e6e8eb;
    line-height: 1.5;
}

.sb-license-status-text {
    font-size: 14px;
    color: #33383e;
}

.sb-license-badge {
    flex: 0 0 auto;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #9aa2ac;
    white-space: nowrap;
}

.sb-license-status[data-state="ACTIVE"] { background: #edf9f0; border-color: #cdeed6; }
.sb-license-status[data-state="ACTIVE"] .sb-license-badge { background: #2ecc71; }
.sb-license-status[data-state="LOCKED"] { background: #fdecec; border-color: #f7cccc; }
.sb-license-status[data-state="LOCKED"] .sb-license-badge { background: #e74c3c; }
.sb-license-status[data-state="loading"] .sb-license-status-text::after { content: "Chargement…"; color: #9aa2ac; }

/* Activation box — collapsed when the subscription is active */
.sb-license-activate {
    margin-top: 18px;
    display: none;
}

.sb-license-activate.sb-open {
    display: block;
}

.sb-license-activate label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #33383e;
    margin-bottom: 6px;
}

.sb-license-key {
    width: 100%;
    font-family: monospace;
    font-size: 13px;
    padding: 10px 12px;
    border: 1px solid #dcdfe3;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
}

.sb-license-key.sb-error {
    border-color: #e74c3c;
}

.sb-license-activate-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.sb-license-activate-msg {
    font-size: 13px;
}

.sb-license-activate-msg.sb-error { color: #e74c3c; }
.sb-license-activate-msg.sb-ok { color: #2ecc71; }

/* Plans */
.sb-license-plans {
    margin-top: 26px;
}

.sb-license-plans h3 {
    font-size: 15px;
    margin: 0 0 12px;
    color: #33383e;
}

.sb-license-plans-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.sb-license-plan {
    border: 1px solid #e6e8eb;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.sb-license-plan:hover {
    border-color: #cfd4da;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .05);
}

.sb-license-plan-label {
    font-size: 14px;
    font-weight: 600;
    color: #33383e;
}

.sb-license-plan-price {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 8px 0 12px;
}

.sb-license-plan.sb-license-pending {
    opacity: .7;
}

.sb-license-empty {
    color: #9aa2ac;
    font-size: 13px;
}

/* Loading spinner on buttons */
.sb-license-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.sb-license-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sb-license-spin .7s linear infinite;
}

/* On the light "Refresh" secondary button the spinner needs a dark track */
.sb-license-plans .sb-license-loading::after,
#license-panel > .input > .sb-btn.sb-license-loading::after {
    border-color: rgba(0, 0, 0, .2);
    border-top-color: #555;
}

@keyframes sb-license-spin {
    to { transform: rotate(360deg); }
}
