/* Referral System - Frontend Styles */

.rsl-wrapper {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* --- Registration Form --- */

.rsl-form {
    background: var(--rsl-bg, #ffffff);
    border-radius: var(--rsl-radius, 8px);
    max-width: var(--rsl-max-width, 500px);
    width: 100%;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.rsl-form__heading {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
}

.rsl-form__subtext {
    margin: 0 0 24px;
    font-size: 15px;
    color: #666;
    text-align: center;
    line-height: 1.5;
}

.rsl-form__message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.rsl-form__message--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.rsl-form__message--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.rsl-form__fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rsl-form__row {
    display: flex;
    gap: 12px;
}

.rsl-form__field {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rsl-form__label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.rsl-form__input {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.rsl-form__input:focus {
    border-color: var(--rsl-primary, #0073aa);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
}

.rsl-form__input--error {
    border-color: #ef4444;
}

.rsl-form__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--rsl-primary, #0073aa);
    color: var(--rsl-btn-text, #ffffff);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    width: 100%;
    margin-top: 4px;
}

.rsl-form__button:hover {
    opacity: 0.9;
}

.rsl-form__button:active {
    transform: scale(0.98);
}

.rsl-form__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rsl-form__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: rsl-spin 0.6s linear infinite;
}

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

/* --- Share Widget --- */

.rsl-share {
    background: var(--rsl-bg, #ffffff);
    border-radius: var(--rsl-radius, 8px);
    max-width: var(--rsl-max-width, 500px);
    width: 100%;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    text-align: center;
}

.rsl-share__heading {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.rsl-share__message {
    margin: 0 0 20px;
    font-size: 15px;
    color: #666;
    line-height: 1.5;
}

.rsl-share__link-box {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.rsl-share__link-input {
    flex: 1;
    padding: 12px 14px;
    border: none;
    font-size: 14px;
    color: #374151;
    background: #f9fafb;
    outline: none;
    min-width: 0;
}

.rsl-share__copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.rsl-share__copy-btn:hover {
    background: #333;
}

.rsl-share__copy-btn svg {
    width: 20px;
    height: 20px;
}

.rsl-share__buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rsl-share__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    text-decoration: none;
}

.rsl-share__btn:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

.rsl-share__btn svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.rsl-share__btn--email {
    background: #1a1a1a;
}

.rsl-share__btn--facebook {
    background: #1a1a1a;
}

.rsl-share__btn--linkedin {
    background: #1a1a1a;
}

.rsl-share__btn--whatsapp {
    background: #1a1a1a;
}

/* Stats */
.rsl-share__stats {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #6b7280;
}

.rsl-share__stats-count {
    font-weight: 700;
    color: var(--rsl-primary, #0073aa);
    font-size: 18px;
}

/* --- Referral Dashboard --- */

.rsl-dashboard {
    background: var(--rsl-bg, #ffffff);
    border-radius: var(--rsl-radius, 8px);
    max-width: var(--rsl-max-width, 500px);
    width: 100%;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.rsl-dashboard__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
}

.rsl-dashboard__desc {
    margin: 0 0 24px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.rsl-dashboard__stats {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.rsl-dashboard__stat-card {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rsl-dashboard__stat-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.rsl-dashboard__stat-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.2;
}

.rsl-dashboard__stat-label {
    display: block;
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.rsl-dashboard__filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rsl-dashboard__filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    background: #f3f4f6;
    color: #374151;
}

.rsl-dashboard__filter-btn:hover {
    background: #e5e7eb;
}

.rsl-dashboard__filter-btn--active {
    background: #1a1a1a;
    color: #fff;
}

.rsl-dashboard__filter-btn--active:hover {
    background: #333;
}

.rsl-dashboard__filter-btn svg {
    flex-shrink: 0;
}

.rsl-dashboard__list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.rsl-dashboard__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f3f4f6;
}

.rsl-dashboard__item:last-child {
    border-bottom: none;
}

.rsl-dashboard__item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rsl-dashboard__item-source {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.rsl-dashboard__item-date {
    font-size: 12px;
    color: #9ca3af;
}

.rsl-dashboard__item-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.rsl-dashboard__item-status--successful {
    background: #f0fdf4;
    color: #15803d;
}

.rsl-dashboard__item-status--pending {
    background: #fffbeb;
    color: #b45309;
}

.rsl-dashboard__item-status svg {
    flex-shrink: 0;
}

.rsl-dashboard__empty {
    text-align: center;
    padding: 24px 0;
    color: #9ca3af;
    font-size: 14px;
}

.rsl-dashboard__item--hidden {
    display: none;
}

/* --- Responsive --- */

@media (max-width: 480px) {
    .rsl-form,
    .rsl-share,
    .rsl-dashboard {
        padding: 24px 20px;
    }

    .rsl-dashboard__stats {
        gap: 8px;
    }

    .rsl-dashboard__stat-card {
        padding: 12px;
    }

    .rsl-dashboard__stat-value {
        font-size: 22px;
    }

    .rsl-form__row {
        flex-direction: column;
        gap: 16px;
    }

    .rsl-form__heading,
    .rsl-share__heading {
        font-size: 20px;
    }

    .rsl-share__buttons {
        gap: 8px;
    }

    .rsl-share__btn {
        width: 44px;
        height: 44px;
    }
}
