/* ══════════════════════════════════════════════════════════════
   СТОРІНКА РЕЄСТРАЦІЇ РЕФЕРЕРА
   ══════════════════════════════════════════════════════════════ */

.rr-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a2e;
}

/* Hero */
.rr-hero {
    text-align: center;
    padding: 56px 24px 48px;
}

.rr-hero__badge {
    display: inline-block;
    padding: 5px 16px;
    background: #eef2ff;
    color: #4a6cf7;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.rr-hero__title {
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px;
    color: #111827;
}

.rr-hero__sub {
    font-size: 18px;
    color: #6b7280;
    max-width: 560px;
    margin: 0 auto 36px;
    line-height: 1.6;
}

.rr-benefits {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.rr-benefit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.rr-benefit__icon { font-size: 18px; }

/* Layout */
.rr-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 60px;
}

@media (max-width: 768px) {
    .rr-layout { grid-template-columns: 1fr; }
}

/* Cards */
.rr-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 36px 32px;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.rr-card__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111827;
}

.rr-card__sub {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 28px;
}

/* Поля форми */
.rr-field {
    margin-bottom: 20px;
}

.rr-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}

.rr-req { color: #ef4444; }

.rr-field__hint {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 5px;
}

.rr-field input[type="text"],
.rr-field input[type="tel"],
.rr-field input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    color: #111827;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}

.rr-field input:focus {
    border-color: #4a6cf7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74,108,247,.12);
}

.rr-field--error input[type="text"],
.rr-field--error input[type="tel"],
.rr-field--error input[type="email"] {
    border-color: #ef4444;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.rr-field__error-msg {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 5px;
}

/* Checkbox */
.rr-field--checkbox { margin-top: 4px; }

.rr-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    font-weight: 400 !important;
    line-height: 1.5;
}

.rr-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: #4a6cf7;
    cursor: pointer;
}

.rr-terms-link {
    color: #4a6cf7;
    text-decoration: underline;
}

/* Кнопка */
.rr-btn-submit {
    width: 100%;
    margin-top: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #4a6cf7, #6a4cf7);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity .2s, transform .1s;
}

.rr-btn-submit:hover { opacity: .92; }
.rr-btn-submit:active { transform: scale(.98); }
.rr-btn-submit:disabled { background: #9ca3af; cursor: not-allowed; transform: none; }

.rr-btn-submit__arrow { font-size: 18px; transition: transform .2s; }
.rr-btn-submit:hover .rr-btn-submit__arrow { transform: translateX(4px); }

/* Повідомлення */
.rr-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.rr-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.rr-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Privacy */
.rr-privacy {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    margin: 16px 0 0;
}

.rr-privacy svg { color: #6ee7b7; flex-shrink: 0; }

/* Умови */
.rr-terms-section {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #f3f4f6;
}

.rr-terms-section:last-of-type { border-bottom: none; }

.rr-terms-icon {
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 2px;
}

.rr-terms-section h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111827;
}

.rr-terms-section ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.7;
}

.rr-terms-footer {
    margin-top: 20px;
    font-size: 13px;
    color: #6b7280;
}

.rr-terms-footer a { color: #4a6cf7; }

/* Кроки */
.rr-steps {
    text-align: center;
    padding: 48px 0 0;
}

.rr-steps__title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 36px;
    color: #111827;
}

.rr-steps__grid {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.rr-step {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
    padding: 24px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
}

.rr-step--arrow {
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
    font-size: 22px;
    color: #d1d5db;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0 4px;
}

@media (max-width: 600px) {
    .rr-step--arrow { display: none; }
    .rr-step { min-width: 120px; }
}

.rr-step__num {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4a6cf7, #6a4cf7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    margin: 0 auto 14px;
}

.rr-step h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111827;
}

.rr-step p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════
   ФОРМА ЗАЯВКИ (referral_form shortcode)
   ══════════════════════════════════════════════════════════════ */

.rl-wrap {
    max-width: 560px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a2e;
}

.rl-greeting {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
    border: 1px solid #c7d2fe;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 28px;
}

.rl-greeting--neutral {
    background: linear-gradient(135deg, #f9fafb 0%, #f0f9ff 100%);
    border-color: #e5e7eb;
}

.rl-greeting__icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

.rl-greeting__title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
}

.rl-greeting__sub {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.rl-form { width: 100%; }

.rl-field {
    margin-bottom: 18px;
}

.rl-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}

.rl-req { color: #ef4444; }

.rl-field input[type="text"],
.rl-field input[type="tel"],
.rl-field input[type="email"],
.rl-field textarea,
.rl-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    color: #111827;
    background: #fafafa;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    font-family: inherit;
}

.rl-field textarea {
    resize: vertical;
    min-height: 80px;
}

.rl-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.rl-field input:focus,
.rl-field textarea:focus,
.rl-select:focus {
    border-color: #4a6cf7;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(74,108,247,.12);
}

.rl-field--ref input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: default;
}

.rl-field--ref-empty input[readonly] {
    color: #9ca3af;
    font-style: italic;
}

.rl-field__hint {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 5px;
}

.rl-field__hint--ok {
    color: #16a34a;
}

.rl-field--error input,
.rl-field--error textarea,
.rl-field--error .rl-select {
    border-color: #ef4444;
    background: #fff5f5;
    box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

.rl-field__error-msg {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 5px;
}

.rl-btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    background: linear-gradient(135deg, #4a6cf7, #6a4cf7);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
    margin-top: 8px;
}

.rl-btn-submit:hover { opacity: .92; }
.rl-btn-submit:active { transform: scale(.99); }
.rl-btn-submit:disabled { opacity: .6; cursor: not-allowed; }

.rl-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

.rl-message.success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
}

.rl-message.error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.rl-privacy {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 16px;
}

/* ══════════════════════════════════════════════════════════════
   СТАРІ СТИЛІ (сумісність)
   ══════════════════════════════════════════════════════════════ */

.referral-notice {
    padding: 12px 16px;
    background: #f0f4ff;
    border-left: 4px solid #4a6cf7;
    border-radius: 4px;
    margin: 16px 0;
}

/* ── Форми ─────────────────────────────────────────────────── */

.referral-form {
    max-width: 480px;
    margin: 0 auto;
}

.referral-form .form-group {
    margin-bottom: 16px;
}

.referral-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
}

.referral-form input,
.referral-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.referral-form input:focus,
.referral-form textarea:focus {
    outline: none;
    border-color: #4a6cf7;
}

.referral-form textarea {
    min-height: 100px;
    resize: vertical;
}

.referral-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.referral-form button[type="submit"]:hover {
    background: #3a5ce5;
}

.referral-form button[type="submit"]:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.referral-form-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
}

.referral-form-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.referral-form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ── Особистий кабінет ─────────────────────────────────────── */

.referral-dashboard {
    max-width: 640px;
    margin: 0 auto;
}

.referral-dashboard__stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.referral-stat {
    flex: 1;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-align: center;
}

.referral-stat__value {
    font-size: 36px;
    font-weight: 700;
    color: #4a6cf7;
    line-height: 1;
    margin-bottom: 6px;
}

.referral-stat__label {
    font-size: 13px;
    color: #6b7280;
}

.referral-dashboard__section {
    margin-bottom: 24px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.referral-dashboard__section h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #374151;
}

.referral-code {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f4ff;
    border: 1px dashed #4a6cf7;
    border-radius: 6px;
    font-family: monospace;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #1e3a8a;
    margin-bottom: 12px;
}

.referral-link-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.referral-link-wrap input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #f9fafb;
    min-width: 0;
}

.referral-btn {
    padding: 8px 16px;
    background: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.referral-btn:hover {
    background: #3a5ce5;
}

.referral-qr img {
    display: block;
    width: 180px;
    height: 180px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
}

.referral-qr a {
    font-size: 13px;
    color: #4a6cf7;
    text-decoration: none;
}

.referral-qr a:hover {
    text-decoration: underline;
}
