/* Zaity Affiliates - Frontend Styles v1.1 */
:root {
    --zaity-primary: #16a34a;
    --zaity-success: #16a34a;
    --zaity-warning: #eab308;
    --zaity-danger:  #dc2626;
    --zaity-purple:  #22c55e;
    --zaity-bg:      #f5f7f2;
    --zaity-border:  #e2e8f0;
    --zaity-text:    #1f2933;
    --zaity-radius:  14px;
    --zaity-shadow:  0 18px 40px rgba(15, 23, 42, .08);
}

/* ── Base ──────────────────────────────────────────────────────── */
.zaity-dashboard, .zaity-register-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--zaity-text);
    max-width: 960px;
    margin: 0 auto;
}

/* ── Header ─────────────────────────────────────────────────────── */
.zaity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #14532d, #16a34a);
    color: white;
    padding: 24px 28px;
    border-radius: var(--zaity-radius);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.zaity-header h2 { margin: 0 0 4px; font-size: 1.4rem; }
.zaity-header p  { margin: 0; opacity: .85; }
.zaity-coupon-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
    padding: 10px 16px;
    border-radius: 8px;
}
.zaity-coupon-badge strong { font-size: 1.3rem; letter-spacing: 3px; font-family: monospace; }
.zaity-copy-btn { background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: .8; transition: opacity .2s; padding: 2px; }
.zaity-copy-btn:hover { opacity: 1; }

/* ── Tabs ───────────────────────────────────────────────────────── */
.zaity-tabs {
    display: flex;
    gap: 4px;
    background: white;
    border: 1px solid var(--zaity-border);
    border-radius: var(--zaity-radius);
    padding: 6px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.zaity-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 500;
    color: #64748b;
    transition: all .2s;
    flex: 1;
    min-width: 120px;
}
.zaity-tab:hover  { background: var(--zaity-bg); color: var(--zaity-primary); }
.zaity-tab.active { background: var(--zaity-primary); color: white; }

/* ── Tab content ────────────────────────────────────────────────── */
.zaity-tab-content { display: none; }
.zaity-tab-content.active { display: block; }

/* ── KPI Grid ───────────────────────────────────────────────────── */
.zaity-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.zaity-kpi {
    padding: 20px 24px;
    border-radius: var(--zaity-radius);
    box-shadow: var(--zaity-shadow);
}
.zaity-kpi-value { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.zaity-kpi-value small { font-size: 1rem; font-weight: 500; }
.zaity-kpi-label { font-size: .83rem; opacity: .8; }
.zaity-kpi-blue   { background: #eff6ff; color: #1d4ed8; }
.zaity-kpi-green  { background: #f0fdf4; color: #15803d; }
.zaity-kpi-orange { background: #fff7ed; color: #c2410c; }
.zaity-kpi-purple { background: #faf5ff; color: #6d28d9; }

/* ── Stats Row ──────────────────────────────────────────────────── */
.zaity-stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.zaity-stat-box {
    background: white;
    border: 1px solid var(--zaity-border);
    border-radius: var(--zaity-radius);
    padding: 20px;
}
.zaity-stat-box h4 { margin: 0 0 12px; font-size: 1rem; color: #475569; border-bottom: 1px solid var(--zaity-border); padding-bottom: 8px; }
.zaity-table-simple { width: 100%; border-collapse: collapse; }
.zaity-table-simple td { padding: 6px 0; font-size: .9rem; border-bottom: 1px solid #f1f5f9; }
.zaity-table-simple td:last-child { text-align: right; }

/* ── Table ──────────────────────────────────────────────────────── */
.zaity-table-wrap { overflow-x: auto; }
.zaity-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.zaity-table th { background: #f8fafc; padding: 12px 14px; text-align: left; font-weight: 600; font-size: .83rem; color: #64748b; border-bottom: 2px solid var(--zaity-border); white-space: nowrap; }
.zaity-table td { padding: 12px 14px; border-bottom: 1px solid var(--zaity-border); }
.zaity-table tr:last-child td { border-bottom: none; }
.zaity-table tr:hover td { background: #f8fafc; }

/* ── Badges ─────────────────────────────────────────────────────── */
.zaity-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.zaity-badge-active  { background: #dcfce7; color: #16a34a; }
.zaity-badge-warning { background: #fef3c7; color: #d97706; }
.zaity-badge-error   { background: #fee2e2; color: #dc2626; }
.zaity-badge-paid    { background: #dbeafe; color: #1d4ed8; }

/* ── Links tab ──────────────────────────────────────────────────── */
.zaity-link-box { background: white; border: 1px solid var(--zaity-border); border-radius: var(--zaity-radius); padding: 20px; margin-bottom: 16px; }
.zaity-link-box label { display: block; font-weight: 600; margin-bottom: 10px; font-size: .95rem; }
.zaity-copy-row { display: flex; gap: 10px; align-items: center; }
.zaity-copy-row input { flex: 1; padding: 10px 14px; border: 1px solid var(--zaity-border); border-radius: 8px; font-size: .9rem; background: #f8fafc; }
.zaity-coupon-share { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.zaity-coupon-large { font-size: 1.8rem; font-weight: 800; letter-spacing: 5px; color: var(--zaity-primary); background: #eff6ff; padding: 10px 20px; border-radius: 8px; font-family: monospace; }
.zaity-link-stats { margin-top: 12px; padding: 10px 14px; background: var(--zaity-bg); border-radius: 8px; font-size: .9rem; color: #64748b; }

/* ── Payment Methods ────────────────────────────────────────────── */
.zaity-payout-balance { margin-bottom: 24px; }
.zaity-payout-gate-notice { margin-bottom: 18px; line-height: 1.55; }
.zaity-payout-button-hint { margin: 12px 0 0; font-size: .88rem; color: #64748b; }

.zaity-earnings-callout {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
    border: 1px solid #fde68a;
    border-radius: var(--zaity-radius);
    padding: 20px 22px;
    margin-bottom: 24px;
}
.zaity-earnings-callout-icon { font-size: 2rem; line-height: 1; }
.zaity-earnings-callout-body { flex: 1; min-width: 0; }
.zaity-earnings-callout-body h4 { margin: 0 0 10px; font-size: 1.05rem; color: var(--zaity-text); }
.zaity-earnings-callout-balance { margin: 0 0 12px; font-size: 1rem; color: #78350f; }
.zaity-earnings-callout-min { display: block; font-size: .85rem; color: #92400e; margin-top: 4px; font-weight: 500; }
.zaity-earnings-callout-rules { margin: 0 0 14px; padding-left: 18px; color: #44403c; font-size: .92rem; line-height: 1.55; }
.zaity-earnings-callout-rules li { margin-bottom: 6px; }
.zaity-earnings-callout-rules li span { color: #78716c; font-weight: 600; }

button.zaity-btn-payout-locked:disabled,
#zaity-request-payout:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.zaity-payout-form-wrap { background: white; border: 1px solid var(--zaity-border); border-radius: var(--zaity-radius); padding: 28px; }
.zaity-payout-form-wrap h3 { margin: 0 0 20px; font-size: 1.2rem; }
.zaity-pay-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}
.zaity-pay-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 10px;
    border: 2px solid var(--zaity-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
    background: white;
}
.zaity-pay-method-card input[type="radio"] { display: none; }
.zaity-pay-method-card:hover { border-color: var(--zaity-primary); background: #eff6ff; }
.zaity-pay-method-card.active { border-color: var(--zaity-primary); background: #eff6ff; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.zaity-pay-icon { font-size: 1.6rem; }
.zaity-pay-label { font-size: .82rem; font-weight: 600; color: var(--zaity-text); line-height: 1.3; }
.zaity-pay-fields { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.zaity-payout-intro { color: #64748b; margin: 0 0 16px; font-size: .92rem; }
.zaity-payout-section-title {
    margin: 24px 0 12px;
    font-size: 1rem;
    color: var(--zaity-text);
    border-bottom: 1px solid var(--zaity-border);
    padding-bottom: 8px;
}
.zaity-payout-form-wrap .zaity-payout-section-title:first-of-type { margin-top: 0; }
.zaity-payout-hint { font-size: .86rem; color: #64748b; margin: -4px 0 14px; line-height: 1.45; }
.zaity-pay-methods-row { margin-bottom: 12px; }
.zaity-pay-methods-agents { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); margin-bottom: 16px; }
.zaity-agent-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 12px;
}
.zaity-form-group-full { grid-column: 1 / -1; }
@media (max-width: 560px) {
    .zaity-agent-fields-grid { grid-template-columns: 1fr; }
}

/* ── Forms ──────────────────────────────────────────────────────── */
.zaity-form-group { margin-bottom: 16px; }
.zaity-form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; }
.zaity-form-group input,
.zaity-form-group select,
.zaity-form-group textarea,
.zaity-pay-info-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--zaity-border);
    border-radius: 8px;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
    background: white;
}
.zaity-form-group input:focus,
.zaity-form-group select:focus,
.zaity-form-group textarea:focus,
.zaity-pay-info-input:focus {
    outline: none;
    border-color: var(--zaity-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.zaity-form-group small { display: block; margin-top: 5px; color: #64748b; font-size: .82rem; }
.zaity-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.zaity-form-terms label { font-size: .9rem; }
.zaity-checkbox-label { display: flex !important; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: normal !important; }
.zaity-checkbox-label input { width: auto !important; margin-top: 2px; }

.zaity-input-group { position: relative; display: flex; }
.zaity-input-group input { flex: 1; border-radius: 8px 0 0 8px !important; }
.zaity-toggle-pwd {
    padding: 0 14px;
    border: 1.5px solid var(--zaity-border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    background: #f8fafc;
    cursor: pointer;
    font-size: 1rem;
}
.zaity-coupon-check-wrap { position: relative; }
.zaity-coupon-status { display: block; margin-top: 5px; font-size: .85rem; font-weight: 600; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.zaity-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    line-height: 1;
}
.zaity-btn-primary { background: linear-gradient(135deg, #16a34a, #22c55e); color: white; }
.zaity-btn-primary:hover { background: linear-gradient(135deg, #15803d, #16a34a); transform: translateY(-1px); box-shadow: 0 12px 30px rgba(22, 163, 74, .45); }
.zaity-btn-secondary { background: #f1f5f9; color: var(--zaity-text); border: 1px solid var(--zaity-border); }
.zaity-btn-secondary:hover { background: #e2e8f0; }
.zaity-btn-lg { padding: 14px 28px; font-size: 1rem; }
.zaity-btn-full { width: 100%; }
.zaity-btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* ── Notices ─────────────────────────────────────────────────────── */
.zaity-notice {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .95rem;
    line-height: 1.5;
}
.zaity-notice-info    { background: #eff6ff; color: #1d4ed8; border-left: 4px solid #2563eb; }
.zaity-notice-success { background: #f0fdf4; color: #15803d; border-left: 4px solid #16a34a; }
.zaity-notice-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #d97706; }
.zaity-notice-error   { background: #fef2f2; color: #991b1b; border-left: 4px solid #dc2626; }

/* ── Empty state ─────────────────────────────────────────────────── */
.zaity-empty { text-align: center; padding: 48px 20px; color: #94a3b8; background: white; border: 2px dashed var(--zaity-border); border-radius: var(--zaity-radius); }

/* ── Register page ───────────────────────────────────────────────── */
.zaity-register-wrap { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; max-width: 1000px; }
.zaity-register-box {
    background: white;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 18px;
    padding: 32px 32px 28px;
    box-shadow: var(--zaity-shadow);
}
.zaity-register-box h2 { margin: 0 0 8px; color: #1f2933; font-size: 1.6rem; font-weight: 700; }
.zaity-register-intro { color: #6b7280; margin-bottom: 24px; line-height: 1.5; font-size: .95rem; }
.zaity-register-benefits {
    background: linear-gradient(145deg, #d6f3df 0%, #b6e7c6 40%, #fef3c7 100%);
    color: #14532d;
    border-radius: 18px;
    padding: 26px 24px;
    align-self: start;
    position: sticky;
    top: 20px;
    box-shadow: 0 18px 45px rgba(22, 101, 52, .25);
}
.zaity-register-benefits h3 { margin: 0 0 20px; font-size: 1.2rem; }
.zaity-register-benefits ul { list-style: none; padding: 0; margin: 0 0 18px; }
.zaity-register-benefits li { padding: 10px 0; border-bottom: 1px solid rgba(20, 83, 45, .18); font-size: .92rem; line-height: 1.4; }
.zaity-register-benefits li:last-child { border-bottom: none; }
.zaity-commission-preview { background: rgba(255,255,255,.55); border-radius: 12px; padding: 14px; margin-top: 4px; border: 1px solid rgba(20, 83, 45, .14); }
.zaity-commission-preview h4 { margin: 0 0 8px; font-size: .95rem; opacity: .9; }
.zaity-commission-preview p { margin: 0; font-size: .9rem; opacity: .95; line-height: 1.5; }
.zaity-gain { font-size: 1.2em; color: #166534; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .zaity-register-wrap   { grid-template-columns: 1fr; }
    .zaity-stats-row       { grid-template-columns: 1fr; }
    .zaity-form-row-2      { grid-template-columns: 1fr; }
    .zaity-kpi-value       { font-size: 1.4rem; }
    .zaity-register-benefits { position: static; }
    .zaity-pay-methods     { grid-template-columns: repeat(2, 1fr); }
    .zaity-tab             { font-size: .82rem; padding: 9px 12px; }
    .zaity-header          { flex-direction: column; align-items: flex-start; }
    .zaity-register-box    { padding: 24px 20px; }
}
@media (max-width: 480px) {
    .zaity-pay-methods { grid-template-columns: repeat(2, 1fr); }
    .zaity-coupon-large { font-size: 1.3rem; letter-spacing: 3px; }
}
