/* ============================================================
   Corporate Lead Referral — Mobile-First UI
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ---------- Page Background ---------- */
.corporate-referral-section {
    min-height: 100vh;
    background: linear-gradient(160deg, #0d1b5e 0%, #1565c0 55%, #0a8fa7 100%);
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.referral-container {
    width: 100%;
    max-width: 520px;
    padding: 0 0 40px;
}

/* ---------- Card ---------- */
.referral-card {
    background: #fff;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.22);
    overflow: hidden;
}

/* ---------- Header ---------- */
.referral-header {
    background: linear-gradient(135deg, #0a8fa7 0%, #21c1e0 100%);
    padding: 20px 20px 18px;
    text-align: center;
    position: relative;
}

.referral-header::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, #0a8fa7, #21c1e0, #0a8fa7);
    opacity: 0.4;
}

.referral-header h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.2px;
}

/* ---------- Form Wrapper ---------- */
.referral-form {
    padding: 18px 16px 22px;
}

/* ---------- Tracker Search Strip ---------- */
.tracker-form {
    background: linear-gradient(135deg, #e8f8fc, #f0f9fc);
    border: 1.5px solid #b2e4ef;
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(10,143,167,0.06);
}

.tracker-form h3 {
    font-size: 12px;
    font-weight: 700;
    color: #0a8fa7;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tracker-form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.tracker-form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tracker-form-group label {
    font-size: 11px;
    font-weight: 700;
    color: #0a8fa7;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

.tracker-form-group input {
    padding: 10px 13px;
    border: 1.5px solid #b2e4ef;
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    color: #222;
    width: 100%;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.tracker-form-group input:focus {
    outline: none;
    border-color: #21c1e0;
    box-shadow: 0 0 0 3px rgba(33,193,224,0.15);
}

.tracker-form-group input::placeholder {
    color: #aac4cc;
    font-size: 13px;
}

.btn-search {
    background: linear-gradient(135deg, #0a8fa7, #21c1e0);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: opacity 0.18s, transform 0.15s;
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-search:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-search:active { transform: translateY(0); }
.btn-search:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.tracker-error {
    background: #fff5f5;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    padding: 9px 13px;
    border-radius: 9px;
    font-size: 12px;
    margin-top: 10px;
    display: none;
    align-items: center;
    gap: 6px;
}

.tracker-error.show { display: flex; }

/* ---------- Result count badge ---------- */
.tracker-result-count {
    display: inline-block;
    background: linear-gradient(135deg, #0a8fa7, #21c1e0);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
    vertical-align: middle;
}

/* ---------- Modal footer ---------- */
.tracker-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 14px 0 4px;
    flex-wrap: wrap;
}

/* ---------- Form Sections ---------- */
.form-section {
    margin-bottom: 6px;
}

.form-section:last-child { margin-bottom: 0; }

.form-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-section-title i { color: #21c1e0; }

/* ---------- Input Groups ---------- */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-row .form-group { margin-bottom: 0; }

.form-row.mt-3 { margin-top: 10px !important; }

.form-group { margin-bottom: 10px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    letter-spacing: 0.1px;
}

/* ---------- Inputs & Select ---------- */
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #dde3ec;
    border-radius: 9px;
    font-size: 13px;
    font-family: inherit;
    color: #222;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.4;
}

/* Custom dropdown arrow */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230a8fa7' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

select.form-control option[value=""] { color: #aaa; }

.form-control:focus {
    outline: none;
    border-color: #21c1e0;
    box-shadow: 0 0 0 3px rgba(33,193,224,0.13);
}

.form-control::placeholder { color: #bbc3cf; font-size: 12px; }
.form-control.is-invalid { border-color: #dc3545; }
.form-control.is-valid   { border-color: #28a745; }

textarea.form-control {
    resize: vertical;
    min-height: 70px;
    line-height: 1.5;
}

/* ---------- Hint ---------- */
.form-hint {
    font-size: 10px;
    color: #aaa;
    margin-top: 3px;
    text-align: center;
    line-height: 1.3;
}

/* ---------- Divider between sections ---------- */
.form-section + .form-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #eee;
}

/* ---------- Submit Button ---------- */
.btn-verify {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #0a8fa7 0%, #21c1e0 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, opacity 0.18s;
    margin-top: 16px;
}

.btn-verify:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10,143,167,0.38);
}

.btn-verify:active:not(:disabled) { transform: translateY(0); }

.btn-verify:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 10px 13px;
    border-radius: 9px;
    margin-bottom: 12px;
    display: none;
    font-size: 12px;
    line-height: 1.4;
    animation: slideDown 0.22s ease;
}

.alert.show { display: block !important; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #fde8ea; color: #7a1520; border: 1px solid #f5c6cb; }

/* jQuery validate inline errors */
span.error, .invalid-feedback {
    display: block;
    font-size: 11px;
    color: #dc3545;
    margin-top: 3px;
}

/* ---------- Tracker Modal — Bottom Sheet on mobile ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.tracker-table-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    inset: 0;
    background: rgba(0,0,0,0.5);
    animation: fadeIn 0.22s ease;
    /* mobile: bottom sheet */
    align-items: flex-end;
    justify-content: center;
}

.tracker-table-modal.show { display: flex; }

.tracker-modal-content {
    background: #fff;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    padding: 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.22);
    animation: slideUp 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
    display: flex;
    flex-direction: column;
}

/* drag handle pill */
.tracker-modal-content::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #d0d8e4;
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
}

.tracker-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #f0f3f8;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.tracker-modal-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0a8fa7;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tracker-modal-close {
    background: #f0f4f8;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s;
    line-height: 1;
    flex-shrink: 0;
}

.tracker-modal-close:hover { background: #dde4ef; color: #222; }

/* scrollable results area */
.tracker-modal-body {
    padding: 12px 12px 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* ---------- Lead Result Cards (mobile default) ---------- */
.tracker-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.tracker-details-table thead { display: none; }

.tracker-details-table tbody { display: flex; flex-direction: column; gap: 12px; }

.tracker-details-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    background: #fff;
    border: 1.5px solid #eef1f6;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(10,143,167,0.08);
    transition: box-shadow 0.18s, transform 0.15s;
}

.tracker-details-table tbody tr:hover {
    box-shadow: 0 4px 16px rgba(10,143,167,0.15);
    transform: translateY(-1px);
}

/* first td = full-width card header */
.tracker-details-table tbody tr td:first-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #0a8fa7, #21c1e0);
    border-left: none;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border-bottom: none;
}

.tracker-details-table tbody tr td:first-child::before {
    content: attr(data-label);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.2);
    padding: 2px 7px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* field cells - 2 columns on mobile */
.tracker-details-table tbody tr {
    grid-template-columns: 1fr 1fr;
}

.tracker-details-table tbody tr td:first-child {
    grid-column: 1 / -1;
}

/* field cells */
.tracker-details-table td {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-bottom: 1px solid #f5f7fa;
    border-right: 1px solid #f5f7fa;
    color: #333;
    word-break: break-word;
    line-height: 1.4;
    font-size: 12px;
    min-width: 0;
}

.tracker-details-table td:last-child { border-bottom: none; }

.tracker-details-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #0a8fa7;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* no-results state */
.tracker-no-results {
    text-align: center;
    padding: 32px 16px;
    color: #aaa;
    font-size: 14px;
}

/* ---------- Status Badges ---------- */
.status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 10px;
    white-space: nowrap;
}

.status-new       { background: #e7f3ff; color: #0066cc; }
.status-contacted { background: #fff3cd; color: #856404; }
.status-converted { background: #d4edda; color: #155724; }
.status-closed    { background: #fde8ea; color: #7a1520; }
.status-submitted { background: #cfe2ff; color: #084298; }

/* ---------- OTP Modal ---------- */
.modal-content {
    border: none;
    border-radius: 18px;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #0a8fa7, #21c1e0);
    color: #fff;
    border: none;
    padding: 14px 18px;
}

.modal-header .close { color: #fff; opacity: 0.8; text-shadow: none; }
.modal-header .close:hover { opacity: 1; }

.modal-title { font-weight: 700; font-size: 15px; }

.modal-body-otp {
    padding: 22px 20px 20px;
    text-align: center;
}

.modal-body-otp p {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.5;
}

.otp-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 14px 0 10px;
}

.otp-input {
    width: 52px;
    height: 52px;
    font-size: 22px;
    text-align: center;
    border: 2px solid #dde3ec;
    border-radius: 12px;
    font-weight: 700;
    color: #222;
    -webkit-appearance: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}

.otp-input:focus {
    outline: none;
    border-color: #21c1e0;
    box-shadow: 0 0 0 3px rgba(33,193,224,0.18);
}

.otp-timer {
    font-size: 12px;
    color: #888;
    margin: 8px 0 14px;
}

.otp-timer.danger { color: #dc3545; font-weight: 600; }

.btn-outline-secondary {
    width: 100%;
    padding: 11px;
    color: #0a8fa7;
    border: 2px solid #0a8fa7;
    background: #fff;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.18s;
    margin-top: 8px;
}

.btn-outline-secondary:hover { background: #f0fafd; }

/* ---------- Success Screen ---------- */
.success-message {
    text-align: center;
    padding: 30px 16px;
}

.success-icon {
    width: 66px;
    height: 66px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 16px;
    box-shadow: 0 6px 20px rgba(40,167,69,0.28);
}

.success-message h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px;
}

.success-message p {
    font-size: 12px;
    color: #666;
    margin: 4px 0;
    line-height: 1.5;
}

.tracking-link {
    background: #f4f7fa;
    padding: 10px 13px;
    border-radius: 9px;
    margin: 14px 0;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.tracking-link-text {
    font-size: 11px;
    color: #555;
    word-break: break-all;
    flex: 1;
}

.btn-copy {
    background: linear-gradient(135deg, #0a8fa7, #21c1e0);
    color: #fff;
    border: none;
    padding: 6px 13px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.18s;
}

.btn-copy:hover { opacity: 0.83; }

/* ---------- Lead Tracking Display ---------- */
.lead-tracking-display { padding: 16px 14px; }

.tracking-header {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0f7fb;
}

.tracking-header h2 {
    color: #0a8fa7;
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tracking-header i { color: #28a745; }
.tracking-subtext { color: #666; font-size: 12px; margin: 0; }

.tracking-content {
    background: #f7f9fc;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid #eef1f6;
}

.tracking-section {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e8edf4;
}

.tracking-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.tracking-section h3 {
    color: #0a8fa7;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tracking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tracking-item {
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid #21c1e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tracking-item label {
    display: block;
    font-weight: 700;
    color: #0a8fa7;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.tracking-item p {
    margin: 0;
    color: #333;
    font-size: 13px;
    word-break: break-word;
}

.tracking-notes {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #21c1e0;
}

.tracking-notes p { color: #333; font-size: 13px; margin: 0; line-height: 1.5; }
.tracking-actions { margin-top: 16px; text-align: center; }

/* ============================================================
   MOBILE — narrow (< 480px): single column inputs
   ============================================================ */
@media (max-width: 479px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tracking-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   TABLET & DESKTOP (600px +)
   ============================================================ */
@media (min-width: 600px) {
    .corporate-referral-section {
        padding: 32px 16px;
        align-items: center;
    }

    .referral-container { padding: 0; }
    .referral-card { border-radius: 20px; }
    .referral-header { padding: 24px 28px 20px; }
    .referral-header h2 { font-size: 21px; }
    .referral-form { padding: 22px 28px 28px; }
    .tracking-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

    /* Modal: centred dialog on tablet+ */
    .tracker-table-modal { align-items: center; padding: 20px; }

    .tracker-modal-content {
        border-radius: 18px;
        max-width: 860px;
        max-height: 78vh;
        animation: fadeIn 0.22s ease;
        box-shadow: 0 20px 56px rgba(0,0,0,0.2);
    }

    .tracker-modal-content::before { display: none; }

    .tracker-modal-body { padding: 14px 18px 20px; }

    /* ---- Tablet/Desktop: multi-column grid ---- */
    .tracker-details-table thead { display: none; }

    .tracker-details-table tbody { gap: 14px; }

    .tracker-details-table tbody tr {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        border-radius: 14px;
    }

    .tracker-details-table tbody tr td:first-child {
        padding: 11px 16px;
        font-size: 14px;
    }

    .tracker-details-table tbody tr td:first-child::before {
        font-size: 9px;
        padding: 2px 7px;
    }

    .tracker-details-table td {
        padding: 8px 14px;
        font-size: 12px;
    }

    .tracker-details-table td::before {
        font-size: 9px;
        margin-bottom: 3px;
    }

    .tracker-modal-footer {
        justify-content: flex-end;
        padding: 14px 0 0;
    }
}

@media (min-width: 900px) {
    .referral-container { max-width: 780px; }
}

/* ---------- Very small screens: single-column cards ---------- */
@media (max-width: 400px) {
    .tracker-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-search {
        width: 100%;
        justify-content: center;
    }

    .tracker-details-table tbody tr {
        grid-template-columns: 1fr;
    }
}
.main-header{padding: 15px !important;}