/* ===================================================
   SE Ranking Backlink Estimator — Styles v1.3.0
   Design : Montserrat + #CE8D54
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* ---- Variables ---- */
:root {
    --sert-primary:      #CE8D54;
    --sert-primary-dark: #b8773e;
    --sert-primary-light:#f5e9dc;
    --sert-text:         #2c2c2c;
    --sert-text-light:   #666;
    --sert-border:       #e2d5c8;
    --sert-bg:           #faf7f4;
    --sert-white:        #ffffff;
    --sert-success:      #27ae60;
    --sert-error-bg:     #fff0f0;
    --sert-error-border: #f5c6c6;
    --sert-error-text:   #c0392b;
    --sert-radius:       12px;
    --sert-shadow:       0 4px 20px rgba(206, 141, 84, 0.12);
}

/* ---- Wrapper général ---- */
.sert-wrapper {
    font-family: 'Montserrat', sans-serif;
    color: var(--sert-text);
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Card ---- */
.sert-card {
    background: var(--sert-white);
    border: 1px solid var(--sert-border);
    border-radius: var(--sert-radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--sert-shadow);
}

/* ---- Formulaire ---- */
.sert-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--sert-text);
    margin: 0 0 8px;
}

.sert-subtitle {
    color: var(--sert-text-light);
    margin: 0 0 28px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.sert-field-group {
    margin-bottom: 20px;
}

.sert-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 8px;
    color: var(--sert-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sert-input,
.sert-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--sert-border);
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: var(--sert-text);
    background: var(--sert-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.sert-input:focus,
.sert-select:focus {
    outline: none;
    border-color: var(--sert-primary);
    box-shadow: 0 0 0 3px rgba(206, 141, 84, 0.18);
}

.sert-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23CE8D54' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 42px;
    cursor: pointer;
}

/* ---- Bouton ---- */
.sert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--sert-primary);
    color: var(--sert-white);
    border: 2px solid var(--sert-primary);
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sert-btn:hover {
    background: var(--sert-primary-dark);
    border-color: var(--sert-primary-dark);
}

.sert-btn:active {
    transform: scale(0.98);
}

.sert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.sert-btn-outline {
    background: transparent;
    color: var(--sert-primary);
}

.sert-btn-outline:hover {
    background: var(--sert-primary-light);
    border-color: var(--sert-primary);
    color: var(--sert-primary-dark);
}

/* ---- Zone de chargement ---- */
.sert-loading {
    text-align: center;
    padding: 40px 20px;
    background: var(--sert-white);
    border: 1px solid var(--sert-border);
    border-radius: var(--sert-radius);
    box-shadow: var(--sert-shadow);
    margin-bottom: 24px;
}

/* Spinner */
.sert-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid var(--sert-primary-light);
    border-top-color: var(--sert-primary);
    border-radius: 50%;
    animation: sert-spin 0.9s linear infinite;
    margin: 0 auto 20px;
}

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

.sert-loading-msg {
    font-weight: 600;
    font-size: 1rem;
    color: var(--sert-text);
    margin: 0 0 16px;
}

.sert-loading-hint {
    font-size: 0.82rem;
    color: var(--sert-text-light);
    margin: 8px 0 0;
}

/* ---- Barre de progression ---- */
.sert-progress-bar {
    width: 100%;
    max-width: 420px;
    height: 8px;
    background: var(--sert-primary-light);
    border-radius: 99px;
    overflow: hidden;
    margin: 0 auto;
}

.sert-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--sert-primary), var(--sert-primary-dark));
    border-radius: 99px;
    transition: width 0.8s ease;
}

/* ---- Erreur ---- */
.sert-error {
    background: var(--sert-error-bg);
    border: 1px solid var(--sert-error-border);
    border-radius: var(--sert-radius);
    padding: 24px 32px;
    margin-bottom: 24px;
    text-align: center;
}

.sert-error p {
    color: var(--sert-error-text);
    font-weight: 500;
    margin: 0 0 16px;
}

/* ---- Recommandation ---- */
.sert-rec-card {
    background: linear-gradient(135deg, var(--sert-primary-light) 0%, #fff8f0 100%);
    border-color: var(--sert-primary);
    border-width: 2px;
}

.sert-rec-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--sert-primary-dark);
}

.sert-rec-text {
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 8px;
    color: var(--sert-text);
}

.sert-rec-text strong {
    color: var(--sert-primary-dark);
    font-weight: 700;
}

.sert-cache-note {
    font-size: 0.82rem;
    color: var(--sert-text-light);
    margin: 8px 0 0;
}

/* ---- Tableau ---- */
.sert-table-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--sert-text);
}

.sert-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.sert-table thead th {
    background: var(--sert-primary);
    color: var(--sert-white);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 14px;
    text-align: left;
    white-space: nowrap;
}

.sert-table thead th.col-pos,
.sert-table tbody td.col-pos {
    text-align: center;
    width: 40px;
}

.sert-table thead th.col-bk,
.sert-table thead th.col-rd,
.sert-table thead th.col-ts,
.sert-table tbody td.col-bk,
.sert-table tbody td.col-rd,
.sert-table tbody td.col-ts {
    text-align: right;
    width: 120px;
}

.sert-table tbody tr {
    border-bottom: 1px solid var(--sert-border);
    transition: background 0.15s;
}

.sert-table tbody tr:hover {
    background: var(--sert-primary-light);
}

.sert-table tbody tr:last-child {
    border-bottom: none;
}

.sert-table tbody td {
    padding: 11px 14px;
    vertical-align: middle;
}

.sert-table .col-url {
    max-width: 300px;
}

.sert-url-link {
    color: var(--sert-primary-dark);
    text-decoration: none;
    word-break: break-all;
    font-size: 0.83rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.sert-url-link:hover {
    text-decoration: underline;
    color: var(--sert-primary);
}

.sert-url-title {
    font-size: 0.78rem;
    color: var(--sert-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    display: block;
    margin-top: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .sert-card {
        padding: 20px 16px;
    }

    .sert-title {
        font-size: 1.3rem;
    }

    .sert-table thead th.col-ts,
    .sert-table tbody td.col-ts {
        display: none;
    }

    .sert-btn {
        width: 100%;
    }
}
