/**
 * TELES HOSTING - Selecteur visuel d'OS style Contabo
 * Theme adapte au template Lagom (fond sombre et clair).
 */

.osp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    padding: 4px 0;
}

.osp-card {
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 18px 12px 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
}

.osp-card:hover {
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    transform: translateY(-2px);
}

.osp-card.active {
    border-color: #f5b921;
    background: rgba(245, 185, 33, 0.08);
    box-shadow: 0 4px 16px rgba(245, 185, 33, .25);
}

.osp-card.active::after {
    content: "\2713";
    position: absolute;
    top: 8px;
    right: 10px;
    width: 22px;
    height: 22px;
    background: #f5b921;
    color: #1e2a3a;
    border-radius: 50%;
    font-size: 13px;
    line-height: 22px;
    font-weight: 700;
}

.osp-card-logo {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.osp-card-logo img {
    max-height: 40px;
    max-width: 40px;
}

.osp-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.osp-card-price {
    font-size: 12px;
    color: #2ecc71;
    font-weight: 600;
}

.osp-card-versions {
    margin-top: 12px;
}

.osp-version-select {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M 1 8 l 10 10 l 10 -10' stroke='%23ffffff' stroke-width='2' fill='none' stroke-linecap='square'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    padding-right: 28px;
}

.osp-version-select option {
    background: #1e2a5e;
    color: #fff;
}

.osp-version-select:focus {
    outline: none;
    border-color: #f5b921;
}

/* Theme clair (si le template utilise un fond clair) */
.main-body-light .osp-card,
body.light-theme .osp-card {
    background: #fff;
    border-color: #e5e9f2;
}

.main-body-light .osp-card-name,
body.light-theme .osp-card-name {
    color: #1e2a3a;
}

/* ================================================================
 * Selecteur de Region style Contabo
 * ================================================================ */
.rsp-wrap {
    padding: 4px 0;
}

.rsp-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.rsp-tab {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
}

.rsp-tab:hover {
    border-color: rgba(255, 255, 255, 0.5);
}

.rsp-tab.active {
    background: #f5b921;
    border-color: #f5b921;
    color: #1e2a3a;
}

.rsp-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.rsp-card {
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    position: relative;
}

.rsp-card:hover {
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.rsp-card.active {
    border-color: #f5b921;
    background: rgba(245, 185, 33, 0.08);
    box-shadow: 0 4px 16px rgba(245, 185, 33, .25);
}

.rsp-card.active::after {
    content: "\2713";
    position: absolute;
    top: 10px;
    right: 12px;
    width: 22px;
    height: 22px;
    background: #f5b921;
    color: #1e2a3a;
    border-radius: 50%;
    font-size: 13px;
    line-height: 22px;
    font-weight: 700;
    text-align: center;
}

.rsp-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.rsp-latency {
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
}

.rsp-card-city {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 8px;
}

.rsp-card-price {
    font-size: 13px;
    font-weight: 600;
    color: #f5b921;
}

.rsp-card-price.free {
    color: #2ecc71;
}


/* Theme clair */
.main-body-light .rsp-card,
body.light-theme .rsp-card {
    background: #fff;
    border-color: #e5e9f2;
}

.main-body-light .rsp-card-title,
body.light-theme .rsp-card-title {
    color: #1e2a3a;
}

/* Responsive */
@media (max-width: 576px) {
    .osp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .rsp-panel {
        grid-template-columns: 1fr;
    }
    .rsp-panel {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.rsp-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.rsp-panel[style*="display:none"],
.rsp-panel[style*="display: none"] {
    display: none !important;
}

/* ================================================================
 * Onglets du selecteur d'OS
 * ================================================================ */
.osp-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12);
    flex-wrap: wrap;
}

.osp-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .18s, border-color .18s;
}

.osp-tab:hover {
    color: #fff;
}

.osp-tab.active {
    color: #f5b921;
    border-bottom-color: #f5b921;
}

.osp-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.osp-panel[style*="display:none"],
.osp-panel[style*="display: none"] {
    display: none !important;
}

.osp-card-price.fee {
    color: #f5b921;
    font-size: 11px;
}

/* Tag de prix dans le resume */
.osp-price-tag {
    font-size: 12px;
    font-weight: 600;
    color: #f5b921;
}

/* ================================================================
 * Bare Metal: grilles de cartes pour options (Port, Bande passante,
 * IPv6, IPMI, RAID) - memes cartes que le selecteur d'OS.
 * ================================================================ */
.osp-cardgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin: 6px 0 4px;
}

.osp-cardgrid .osp-card-opt {
    cursor: pointer;
    text-align: center;
}

.osp-cardgrid .osp-card-logo {
    height: 34px;
    margin-bottom: 6px;
}

.osp-cardgrid .osp-card-logo img {
    max-height: 34px;
    max-width: 34px;
    opacity: .85;
}

.osp-cardgrid .osp-card-name {
    font-size: 13px;
    line-height: 1.35;
}

.main-body-light .osp-cardgrid .osp-card-name,
body.light-theme .osp-cardgrid .osp-card-name {
    color: #1e2a3a;
}
