.referral-page {
    padding: 2.5rem 0 4rem;
}

.referral-campaign {
    margin: 1.5rem 0;
}

.referral-hero {
    display: grid;
    gap: 2rem;
    align-items: start;
}

.referral-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.referral-title {
    font-size: clamp(1.6rem, 2.2vw, 2.4rem);
    margin: 0.5rem 0 1rem;
    color: var(--text-light);
}

.referral-lead {
    color: var(--text-medium);
    margin-bottom: 1.5rem;
}

.referral-points {
    display: grid;
    gap: 0.6rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.referral-points li {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    color: var(--text-light);
}

.referral-point-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.referral-card {
    background: var(--medium-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    color: var(--text-medium);
}

.referral-card h3,
.referral-card h4 {
    margin-top: 0;
    color: var(--text-light);
}

.referral-card p {
    color: inherit;
}

.referral-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.referral-form label {
    font-weight: 600;
    color: var(--text-light);
}

.referral-form input {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--dark-bg);
    color: var(--text-light);
}

.referral-form input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.referral-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    border: none;
    background: var(--accent-color);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
}

.referral-btn:hover {
    background: var(--accent-hover);
}

.referral-btn[disabled],
.referral-btn.is-disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.referral-btn[disabled]:hover,
.referral-btn.is-disabled:hover {
    background: var(--border-color);
}

.referral-status {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-medium);
}

.referral-status.is-error {
    color: #ffb4b4;
}

.referral-status.is-success {
    color: #8fe3b7;
}

.referral-status.is-info {
    color: #9fd1ff;
}

.referral-coupons {
    margin-top: 1.2rem;
}

.referral-coupon-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.75rem;
}

.referral-coupon-item {
    background: var(--dark-bg);
    border-radius: 12px;
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.referral-coupon-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.referral-coupon-note {
    color: var(--text-medium);
    margin-top: 0.6rem;
    white-space: pre-wrap;
}

.referral-coupon-link {
    display: inline-flex;
    margin-top: 0.7rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.referral-coupon-link:hover {
    text-decoration: underline;
}

.referral-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.referral-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}

body.theme-light .referral-card {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1a202c;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body.theme-light .referral-card h3,
body.theme-light .referral-card h4 {
    color: #2d3748;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

body.theme-light .referral-card .referral-note,
body.theme-light .referral-card .referral-status,
body.theme-light .referral-card .referral-coupon-meta {
    color: #718096;
}

body.theme-light .referral-card .referral-coupon-item {
    background: #f7fafc;
    border-color: #e2e8f0;
}

/* Referral Link Styling */
.referral-link-container {
    display: flex;
    gap: 8px;
    margin: 1.5rem 0;
    align-items: stretch;
}

.referral-link-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.referral-link-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--dark-bg);
    color: var(--text-light);
    font-family: monospace;
    font-size: 0.95rem;
}

body.theme-light .referral-link-input {
    background: #f7fafc;
    border-color: #cbd5e1;
    color: #475569;
}

.referral-open-btn,
.referral-copy-btn,
.referral-copy-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 1.2rem;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.referral-open-btn {
    background: #334155;
}

.referral-copy-share-btn {
    background: #0ea5e9;
}

.referral-open-btn:hover,
.referral-copy-btn:hover,
.referral-copy-share-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.referral-open-btn:active,
.referral-copy-btn:active,
.referral-copy-share-btn:active {
    transform: translateY(0);
}

.referral-share-actions {
    display: flex;
    gap: 12px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s;
}

.share-btn:hover {
    opacity: 0.9;
}

.share-btn.twitter {
    background-color: #1DA1F2;
    color: white;
}

.share-btn.line {
    background-color: #06C755;
    color: white;
}

.share-btn.email {
    background-color: #64748b;
    color: white;
}

.share-btn.facebook {
    background-color: #1877F2;
    color: white;
}

.referral-share-panel {
    display: grid;
    gap: 1.2rem;
}

.referral-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.referral-share-status {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.referral-share-status.is-success {
    color: #8fe3b7;
}

.referral-share-status.is-error {
    color: #ffb4b4;
}

.referral-share-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.referral-share-steps li {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.referral-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.referral-link-box {
    background: var(--dark-bg);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
}

body.theme-light .referral-link-box {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.referral-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.6rem;
    align-items: center;
}

.referral-share-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.referral-native-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 1.2rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.referral-native-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.referral-message-box {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    display: grid;
    gap: 0.6rem;
}

body.theme-light .referral-message-box {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.referral-message-text {
    width: 100%;
    min-height: 90px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-light);
    padding: 0.75rem;
    resize: vertical;
    font-size: 0.9rem;
    line-height: 1.5;
}

body.theme-light .referral-message-text {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}

.referral-message-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.referral-share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.share-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--dark-bg);
    color: var(--text-light);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.share-tile:hover {
    transform: translateY(-1px);
    border-color: var(--accent-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.share-tile.line {
    background-color: #06C755;
    color: #ffffff;
    border-color: transparent;
}

.share-tile.email {
    background-color: #64748b;
    color: #ffffff;
    border-color: transparent;
}

.share-tile.x {
    background-color: #0f172a;
    color: #ffffff;
    border-color: transparent;
}

.share-tile.facebook {
    background-color: #1877F2;
    color: #ffffff;
    border-color: transparent;
}

.share-tile.whatsapp {
    background-color: #25D366;
    color: #ffffff;
    border-color: transparent;
}

.share-tile.telegram {
    background-color: #229ED9;
    color: #ffffff;
    border-color: transparent;
}

.share-tile.linkedin {
    background-color: #0A66C2;
    color: #ffffff;
    border-color: transparent;
}

.share-tile.sms {
    background-color: #334155;
    color: #ffffff;
    border-color: transparent;
}

@media (min-width: 900px) {
    .referral-hero {
        grid-template-columns: 1.1fr 0.9fr;
    }
}

@media (max-width: 720px) {
    .referral-card {
        padding: 1.2rem;
    }

    .referral-btn {
        width: 100%;
    }

    .referral-link-actions > * {
        flex: 1 1 100%;
    }

    .referral-link-row {
        grid-template-columns: 1fr;
    }

    .referral-share-primary > * {
        flex: 1 1 100%;
    }

    .referral-share-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .share-tile {
        justify-content: center;
    }
}
