﻿@font-face {
    font-family: Vazirmatn;
    src: url("../fonts/iransans/IRANSansWeb(FaNum).woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --cp-primary: #2d4590;
    --cp-primary-deep: #1a2749;
    --cp-accent: #c9a24a;
    --cp-bg: #eef2f8;
    --cp-card: #ffffff;
    --cp-text: #131c38;
    --cp-muted: #5b6785;
    --cp-line: #c5cedc;
    --cp-ok: #1f7a4d;
    --cp-ok-bg: #e7f6ee;
    --cp-off: #b42318;
    --cp-off-bg: #fdecea;
    --cp-warn: #9a6700;
    --cp-warn-bg: #fff6db;
    --cp-radius: 20px;
    --cp-shadow: 0 18px 50px rgba(26, 39, 73, .12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
    font-family: Vazirmatn, Tahoma, sans-serif;
    color: var(--cp-text);
    background: var(--cp-bg);
}

.cp-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #14203f 0%, #2d4590 58%, #3d5cb0 100%);
}

.cp-login-bg { position: absolute; inset: 0; pointer-events: none; }
.cp-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    opacity: .35;
}
.cp-orb-a { width: 280px; height: 280px; background: #c9a24a; top: -80px; left: -40px; }
.cp-orb-b { width: 360px; height: 360px; background: #7ea0ff; bottom: -120px; right: -80px; }
.cp-grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
    background-size: 28px 28px;
}

.cp-login-shell {
    width: min(1040px, 100%);
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 28px;
    position: relative;
    z-index: 1;
}

.cp-login-hero { color: #fff; padding: 18px 8px; }
.cp-login-hero h1 { font-size: 38px; margin: 22px 0 12px; line-height: 1.25; }
.cp-login-hero p { color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.9; margin: 0 0 22px; }
.cp-hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cp-hero-points li { display: flex; gap: 10px; align-items: center; color: rgba(255,255,255,.92); }
.cp-hero-points i { color: var(--cp-accent); }

.cp-brand { display: flex; align-items: center; gap: 12px; }
.cp-brand-mark {
    width: 46px; height: 46px; border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, #c9a24a, #a9842c);
    color: #1a2749; font-size: 20px;
}
.cp-brand strong, .cp-brand small { display: block; }
.cp-brand small { opacity: .75; font-weight: 400; }

.cp-login-card {
    background: var(--cp-card);
    border-radius: 28px;
    box-shadow: var(--cp-shadow);
    padding: 32px 28px;
    min-height: 420px;
}

.cp-step { display: none; }
.cp-step.is-active { display: block; animation: cpIn .28s ease; }
.cp-kicker { color: var(--cp-primary); font-size: 12px; font-weight: 700; }
.cp-step h2 { margin: 8px 0 6px; font-size: 26px; }
.cp-muted { color: var(--cp-muted); line-height: 1.8; }
.cp-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    font-variant-numeric: tabular-nums;
    text-align: left;
}
.cp-pay-row .cp-ltr {
    letter-spacing: .04em;
}
.cp-label { display: block; margin: 18px 0 8px; font-weight: 700; font-size: 13px; }
.cp-phone-wrap {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--cp-line); border-radius: 14px;
    padding: 0 14px; background: #f7f9fc; height: 52px;
}
.cp-phone-wrap i { color: var(--cp-primary); font-size: 20px; }
.cp-input {
    border: 0; background: transparent; width: 100%; height: 50px;
    font: inherit; font-size: 18px; letter-spacing: .08em; outline: none;
}
.cp-btn {
    width: 100%; height: 50px; border: 0; border-radius: 14px;
    font: inherit; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.cp-btn-primary { background: var(--cp-primary); color: #fff; margin-top: 18px; }
.cp-btn-primary:disabled { opacity: .55; cursor: default; }
.cp-btn-sm {
    width: auto;
    min-width: 110px;
    height: 36px;
    margin-top: 0;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    text-decoration: none;
}
.cp-btn-ghost {
    background: #fff;
    color: #9a3b3b;
    border: 1px solid #ead4d4;
}
.cp-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.cp-error { color: var(--cp-off); margin: 10px 0 0; font-size: 13px; }
.cp-back {
    border: 0; background: transparent; color: var(--cp-primary);
    font: inherit; cursor: pointer; padding: 0; margin-bottom: 8px;
}
.cp-otp { display: flex; gap: 10px; justify-content: center; margin: 22px 0 8px; direction: ltr; }
.cp-otp-box {
    width: 58px; height: 64px; border-radius: 14px; border: 1px solid var(--cp-line);
    text-align: center; font-size: 26px; font-weight: 700; outline: none;
}
.cp-otp-box:focus { border-color: var(--cp-primary); box-shadow: 0 0 0 4px rgba(45,69,144,.12); }
.cp-otp-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--cp-muted); }
.cp-link { border: 0; background: none; color: var(--cp-primary); font: inherit; cursor: pointer; }
.cp-link:disabled { color: var(--cp-line); cursor: default; }

.cp-app { min-height: 100vh; }
.cp-shell { min-height: 100vh; display: flex; flex-direction: column; }
.cp-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; background: #fff; border-bottom: 1px solid var(--cp-line);
    position: sticky; top: 0; z-index: 5;
}
.cp-brand.is-compact .cp-brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.cp-topbar-user { display: flex; align-items: center; gap: 10px; }
.cp-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--cp-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.cp-icon-btn {
    width: 40px; height: 40px; border: 1px solid var(--cp-line); border-radius: 12px;
    background: #fff; color: var(--cp-primary); cursor: pointer;
}
.cp-tabs {
    display: flex; gap: 8px; padding: 12px 20px 0;
    background: transparent;
}
.cp-tab {
    flex: 1; border: 0; background: #fff; color: var(--cp-muted);
    border-radius: 14px; height: 46px; font: inherit; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 1px 0 var(--cp-line);
}
.cp-tab.is-active { background: var(--cp-primary); color: #fff; }
.cp-main { padding: 18px 20px 28px; width: min(980px, 100%); margin: 0 auto; flex: 1; }
.cp-view { display: none; }
.cp-view.is-active { display: block; animation: cpIn .24s ease; }

.cp-hero-card {
    background: linear-gradient(135deg, var(--cp-primary-deep), var(--cp-primary));
    color: #fff; border-radius: var(--cp-radius); padding: 24px;
    box-shadow: var(--cp-shadow);
}
.cp-hero-card h1 { margin: 6px 0 8px; font-size: 28px; }
.cp-hero-card .cp-muted { color: rgba(255,255,255,.78); }
.cp-hero-card .cp-kicker { color: var(--cp-accent); }

.cp-stat-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0;
}
.cp-stat {
    background: #fff; border-radius: 16px; padding: 16px;
    border: 1px solid var(--cp-line);
}
.cp-stat b { display: block; font-size: 20px; margin-top: 6px; }
.cp-stat b .cp-status {
    display: inline-flex;
    vertical-align: middle;
    margin-right: 6px;
    font-size: 12px;
    height: 24px;
}
.cp-stat span { color: var(--cp-muted); font-size: 12px; }

.cp-panel {
    background: #fff; border-radius: 16px; padding: 16px 18px;
    border: 1px solid var(--cp-line);
}
.cp-panel h2 { margin: 0 0 8px; font-size: 16px; }
.cp-pay-row {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-top: 1px dashed var(--cp-line);
}
.cp-pay-row a { color: var(--cp-primary); text-decoration: none; }

.cp-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cp-toolbar h1 { margin: 0; font-size: 22px; }
.cp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-chip {
    border: 1px solid var(--cp-line); background: #fff; color: var(--cp-muted);
    border-radius: 999px; height: 34px; padding: 0 14px; font: inherit; cursor: pointer;
}
.cp-chip.is-active { background: var(--cp-primary); border-color: var(--cp-primary); color: #fff; }

.cp-list { display: grid; gap: 12px; }
.cp-item {
    background: #fff; border-radius: 16px; padding: 16px;
    border: 1px solid var(--cp-line);
}
.cp-item-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cp-item h3 { margin: 0 0 4px; font-size: 16px; }
.cp-item .meta { color: var(--cp-muted); font-size: 12px; line-height: 1.8; }
.cp-item-amount { font-weight: 700; color: var(--cp-primary); white-space: nowrap; }

.cp-status {
    display: inline-flex; align-items: center; min-height: 26px;
    padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 700;
}
.cp-status.is-on { background: var(--cp-ok-bg); color: var(--cp-ok); }
.cp-status.is-off { background: var(--cp-off-bg); color: var(--cp-off); }
.cp-status.is-neutral { background: #eef1f6; color: var(--cp-muted); }
.cp-status.is-delay-1 { background: var(--cp-warn-bg); color: var(--cp-warn); }

.cp-empty {
    text-align: center; padding: 40px 16px; color: var(--cp-muted);
    background: #fff; border-radius: 16px; border: 1px dashed var(--cp-line);
}
.cp-skel { height: 88px; border-radius: 16px; background: linear-gradient(90deg, #e8edf4, #f7f9fc, #e8edf4); background-size: 200% 100%; animation: cpSk 1.2s infinite; }

@keyframes cpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cpSk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

@media (max-width: 860px) {
    .cp-login-shell { grid-template-columns: 1fr; }
    .cp-login-hero { display: none; }
    .cp-login-card { min-height: auto; }
}

@media (max-width: 768px) {
    .cp-topbar { order: 1; }
    .cp-main { order: 2; }
    .cp-tabs { order: 3; }
    .cp-tabs {
        position: sticky; bottom: 0; top: auto; order: 3;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        background: #fff; border-top: 1px solid var(--cp-line);
        margin-top: auto;
    }
    .cp-shell { padding-bottom: 0; }
    .cp-tab { flex-direction: column; height: 58px; gap: 4px; font-size: 11px; box-shadow: none; background: transparent; }
    .cp-tab.is-active { background: rgba(45,69,144,.1); color: var(--cp-primary); }
    .cp-stat-grid { grid-template-columns: 1fr 1fr; }
    .cp-topbar { padding: 12px 14px; }
    .cp-main { padding: 14px 14px 20px; }
}

@media (min-width: 769px) {
    .cp-tabs { position: sticky; top: 69px; z-index: 4; background: var(--cp-bg); padding-bottom: 8px; }
}

/* Payment modal — viewport-centered (must stay a direct body child; fixed to viewport) */
.cp-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100dvh;
    margin: 0 !important;
    z-index: 20000;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(19, 28, 56, .48);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.cp-modal[hidden] {
    display: none !important;
}
body.cp-modal-open {
    overflow: hidden !important;
}
.cp-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
    max-height: min(90vh, 90dvh);
    margin: auto;
    flex-shrink: 0;
    background: var(--cp-card);
    border: 1px solid var(--cp-line);
    border-radius: 18px;
    box-shadow: var(--cp-shadow);
    padding: 0;
    overflow: auto;
    direction: rtl;
}
.cp-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--cp-line);
}
.cp-modal-head h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--cp-text);
}
.cp-modal-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--cp-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cp-modal-close:hover {
    background: rgba(45, 69, 144, .08);
    color: var(--cp-primary);
}
.cp-modal-body { padding: 16px; }
.cp-modal-body > .cp-muted { margin: 0; }
.cp-modal-field { margin-top: 14px; }
.cp-modal-field .cp-label { margin-top: 0; }
.cp-modal-field .cp-input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--cp-line);
    border-radius: 12px;
    padding: 0 14px;
    font: inherit;
    background: #fff;
    color: var(--cp-text);
}
.cp-modal-field .cp-input:focus {
    outline: none;
    border-color: var(--cp-primary);
    box-shadow: 0 0 0 4px rgba(45, 69, 144, .12);
}
.cp-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    padding: 0 16px 16px;
}
.cp-modal-actions .cp-btn {
    margin-top: 0;
    flex: 1;
    height: 42px;
}
.cp-modal.is-alert .cp-modal-actions #cpPayModalCancel { display: none; }
.cp-modal.is-busy .cp-modal-actions #cpPayModalCancel,
.cp-modal.is-busy .cp-modal-actions #cpPayModalOk,
.cp-modal.is-busy .cp-modal-close { display: none !important; }
.cp-modal-busy {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}
.cp-modal-busy[hidden] { display: none !important; }
.cp-modal-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid rgba(45, 69, 144, .18);
    border-top-color: var(--cp-primary);
    animation: cpSpin .7s linear infinite;
}
@keyframes cpSpin {
    to { transform: rotate(360deg); }
}
.cp-modal.is-info .cp-modal-head h2 { color: var(--cp-primary); }
.cp-modal.is-warning .cp-modal-head h2 { color: var(--cp-warn); }
.cp-modal.is-error .cp-modal-head h2 { color: var(--cp-off); }
