﻿/* ============================================================
   سامانه اعضای دوقلوهای خراسان رضوی
   Pure CSS - Mobile First - Fully Responsive - RTL
   ============================================================ */

:root {
    --color-primary: #006B5B;
    --color-primary-dark: #00584a;
    --color-primary-soft: #e6f1ee;
    --color-secondary: #C9A227;
    --color-secondary-soft: #f7efd6;
    --color-bg: #F8F6F0;
    --color-card: #FFFFFF;
    --color-text: #222;
    --color-muted: #6b6b6b;
    --color-border: #E5E5E5;
    --color-success: #2E7D32;
    --color-danger: #D32F2F;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --shadow-sm: 0 2px 6px rgba(20, 20, 20, 0.04);
    --shadow-md: 0 6px 18px rgba(20, 20, 20, 0.06);
    --shadow-lg: 0 18px 40px rgba(20, 20, 20, 0.10);
    --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
    --frame-max: 430px;
    --frame-max-desktop: 1180px;
    --pad: 18px;
}


* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100dvh;
    background: radial-gradient(circle at 15% 0%, #eef4f2 0%, transparent 45%), radial-gradient(circle at 100% 100%, #f7efd6 0%, transparent 45%), var(--color-bg);
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

/* ---------- Frame ---------- */
.page {
    min-height: 100dvh;
    display: flex;
    justify-content: center;
}

    .page[hidden] {
        display: none;
    }

.app-frame {
    width: 100%;
    max-width: var(--frame-max);
    background: var(--color-bg);
    min-height: 100dvh;
    position: relative;
}

@media (min-width: 480px) and (max-width: 899px) {
    .app-frame {
        box-shadow: var(--shadow-lg);
        margin: 24px 0;
        min-height: calc(100dvh - 48px);
        border-radius: 28px;
        overflow: hidden;
    }
}

/* ---------- Desktop frame ---------- */
@media (min-width: 900px) {
    :root {
        --pad: 28px;
    }

    .app-frame {
        max-width: var(--frame-max-desktop);
        background: transparent;
        padding: 24px 24px 40px;
    }

    .page--login .app-frame {
        max-width: 480px;
    }

    #menuBtn {
        display: none;
    }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.page--login .app-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px var(--pad);
}

.login-card {
    width: 100%;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px 26px;
    animation: fadeUp .5s ease both;
}

@media (min-width: 900px) {
    .login-card {
        padding: 40px 36px;
        box-shadow: var(--shadow-lg);
    }
}

.brand {
    text-align: center;
    margin-bottom: 22px;
}

.brand__logo {
    width: 82px;
    height: 82px;
    border-radius: 26px;
    background: var(--color-primary-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.brand__title {
    font-size: 18px;
    font-weight: 700;
    margin: 4px 0 6px;
    color: var(--color-primary);
    line-height: 1.5;
}

.brand__subtitle {
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
}

/* ---------- Forms ---------- */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .field label {
        font-size: 14px;
        color: var(--color-text);
        font-weight: 600;
    }

    .field input,
    .field textarea,
    .field select {
        font-family: inherit;
        font-size: 16px;
        padding: 14px 14px;
        border: 1.5px solid var(--color-border);
        border-radius: var(--radius);
        background: #fff;
        color: var(--color-text);
        outline: none;
        transition: border-color .2s, box-shadow .2s;
        width: 100%;
    }

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

        .field input:focus,
        .field textarea:focus,
        .field select:focus {
            border-color: var(--color-primary);
            box-shadow: 0 0 0 4px rgba(0, 107, 91, 0.12);
        }

.field__error {
    color: var(--color-danger);
    font-size: 13px;
    min-height: 1em;
}

/* ---------- Buttons ---------- */
.btn {
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius);
    border: none;
    padding: 14px 18px;
    cursor: pointer;
    transition: transform .1s ease, background .2s ease, box-shadow .2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
}

    .btn:active {
        transform: translateY(1px);
    }

.btn-logout {
    display: none;
}

.btn--primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0,107,91,0.24);
}

    .btn--primary:hover {
        background: var(--color-primary-dark);
    }

.btn--secondary {
    background: var(--color-secondary);
    color: #fff;
}

.btn--outline {
    background: #fff;
    border: 1.5px solid var(--color-border);
    color: var(--color-text);
}

.btn--danger {
    background: var(--color-danger);
    color: #fff;
}

.btn--block {
    width: 100%;
}

.btn--link {
    background: transparent;
    color: var(--color-primary);
    min-height: auto;
    padding: 10px 4px;
    font-weight: 600;
    font-size: 14px;
}

    .btn--link:hover {
        text-decoration: underline;
    }

/* ============================================================
   DASHBOARD
   ============================================================ */
.page--dashboard .app-frame {
    padding-bottom: 32px;
}


.topbar__brand {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.topbar__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1.4;
}

.topbar__subtitle {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    margin-top: 2px;
}

@media (min-width: 900px) {
    .topbar__title {
        font-size: 16px;
    }

    .topbar__subtitle {
        font-size: 13px;
    }
}

.topbar__logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-secondary-soft);
    border: 2px solid var(--color-secondary);
    flex-shrink: 0;
}

    .topbar__logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.topbar__logo--fallback {
    background: var(--color-secondary);
    position: relative;
}

    .topbar__logo--fallback::after {
        content: "☾";
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 22px;
    }

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.14);
    border: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    flex-shrink: 0;
    transition: background .2s;
}

    .icon-btn:hover {
        background: rgba(255,255,255,0.24);
    }

.hamburger, .hamburger::before, .hamburger::after {
    content: "";
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
}

    .hamburger::before {
        position: absolute;
        top: -6px;
        width: 20px;
    }

    .hamburger::after {
        position: absolute;
        top: 6px;
        width: 14px;
    }

/* ---------- Dashboard main grid (desktop) ---------- */
.dash-main {
    display: block;
}

@media (min-width: 900px) {
    .dash-main {
        display: grid;
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 24px;
        align-items: start;
        margin-top: 24px;
    }

    .btn-logout {
        display: block;
    }

    .dash-main > .services {
        padding: 0;
    }

    .dash-main > .bank-card {
        margin: 0;
    }

    .dash-main > .chart-card {
        margin: 0;
    }

    .dash-col-right {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
}

/* ---------- Bank card ---------- */
.bank-card {
    margin: 20px var(--pad) 8px;
    padding: 22px 20px;
    border-radius: var(--radius-lg);
    color: #fff;
    background: radial-gradient(circle at 100% 0%, rgba(201,162,39,0.55), transparent 60%), linear-gradient(135deg, #007565, #004a3e);
    box-shadow: 0 16px 34px rgba(0,90,75,0.28);
    position: relative;
    overflow: hidden;
    animation: fadeUp .5s ease both;
}

    .bank-card::after {
        content: "";
        position: absolute;
        width: 180px;
        height: 180px;
        border-radius: 50%;
        background: rgba(255,255,255,0.06);
        bottom: -80px;
        left: -60px;
    }

.bank-card__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
}

.bank-card__label {
    font-size: 13px;
    opacity: 0.85;
}

.bank-card__chip {
    width: 40px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f2d478, #b98a1a);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
    position: relative;
}

    .bank-card__chip::before,
    .bank-card__chip::after {
        content: "";
        position: absolute;
        left: 4px;
        right: 4px;
        height: 1px;
        background: rgba(0,0,0,0.25);
    }

    .bank-card__chip::before {
        top: 9px;
    }

    .bank-card__chip::after {
        top: 18px;
    }

.bank-card__number {
    font-size: 20px;
    letter-spacing: 3px;
    font-weight: 600;
    margin-bottom: 22px;
    font-family: "Vazirmatn", monospace;
}

.bank-card__bottom {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 8px;
}

.bank-card__caption {
    font-size: 12px;
    opacity: 0.8;
}

.bank-card__balance {
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
}

    .bank-card__balance span {
        font-size: 13px;
        font-weight: 500;
        opacity: 0.85;
    }

.bank-card__brand {
    font-size: 12px;
    opacity: 0.85;
    text-align: left;
    max-width: 40%;
}

/* ---------- Section title ---------- */
.section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--color-text);
}

@media (min-width: 900px) {
    .section-title {
        font-size: 18px;
    }
}

/* ---------- Services ---------- */
.services {
    padding: 22px var(--pad) 6px;
}

.grid {
    display: grid;
    gap: 12px;
}

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

@media (min-width: 520px) {
    .grid--2 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (min-width: 900px) {
    .grid--2 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }
}

.svc-card {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, border-color .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 130px;
    animation: fadeUp .4s ease both;
}

    .svc-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
        border-color: var(--color-primary-soft);
    }

.svc-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e6f1ee, #d1e5e0);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0,107,91,0.08);
}

    .svc-card__icon svg {
        width: 26px;
        height: 26px;
    }

.svc-card--alt .svc-card__icon {
    background: linear-gradient(135deg, #f7efd6, #ecdfae);
    color: var(--color-secondary);
    box-shadow: inset 0 0 0 1px rgba(201,162,39,0.15);
}

.svc-card__label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

@media (min-width: 900px) {
    .svc-card {
        min-height: 150px;
        padding: 22px 12px;
    }

    .svc-card__icon {
        width: 60px;
        height: 60px;
    }

        .svc-card__icon svg {
            width: 28px;
            height: 28px;
        }

    .svc-card__label {
        font-size: 15px;
    }
}

/* ---------- Chart ---------- */
.chart-card {
    margin: 20px var(--pad) 0;
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 18px 14px 10px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.chart-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.chart-card__hint {
    font-size: 12px;
    color: var(--color-muted);
}

#balanceChart {
    width: 100%;
    height: auto;
    display: block;
}

/* ---------- Footer ---------- */
.footer {
    margin: 26px 0 0;
    background: var(--color-primary);
    color: #fff;
    padding: 22px var(--pad);
    border-radius: 22px 22px 0 0;
}

@media (min-width: 900px) {
    .footer {
        border-radius: 22px;
        margin-top: 28px;
        padding: 28px;
    }
}

.footer__title {
    font-size: 16px;
    margin: 0 0 12px;
    color: var(--color-secondary);
}

.footer__grid {
    display: grid;
    gap: 12px;
}

@media (min-width: 700px) {
    .footer__grid {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
}

.footer__line {
    margin: 4px 0;
    font-size: 14px;
}

    .footer__line span {
        opacity: 0.75;
    }

.footer__links {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.footer__link {
    background: rgba(255,255,255,0.12);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    transition: background .2s;
}

    .footer__link:hover {
        background: rgba(255,255,255,0.22);
    }

.footer__copy {
    margin-top: 16px;
    font-size: 12px;
    opacity: 0.7;
    text-align: center;
}

/* ============================================================
   DRAWER
   ============================================================ */
.drawer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 90;
}

    .drawer.open {
        pointer-events: auto;
    }
        /* .drawer__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity .25s ease;
} */
        .drawer.open .drawer__backdrop {
            opacity: 1;
        }

.drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 82%;
    max-width: 340px;
    background: #fff;
    box-shadow: -12px 0 30px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.2,.7,.2,1);
    display: flex;
    flex-direction: column;
}

.drawer.open .drawer__panel {
    transform: translateX(0);
}

.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px var(--pad);
    background: var(--color-primary);
    color: #fff;
}

.drawer__title {
    font-weight: 700;
}

.drawer__nav {
    display: flex;
    flex-direction: column;
    padding: 10px 8px;
}

.drawer__item {
    background: transparent;
    border: none;
    text-align: right;
    padding: 16px 14px;
    border-radius: 12px;
    font-size: 16px;
    color: var(--color-text);
    cursor: pointer;
    font-weight: 500;
    transition: background .2s;
}

    .drawer__item:hover {
        background: var(--color-primary-soft);
        color: var(--color-primary);
    }

.drawer__item--danger {
    color: var(--color-danger);
}

    .drawer__item--danger:hover {
        background: #fdecec;
        color: var(--color-danger);
    }

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
}

    .modal.open {
        display: block;
    }

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 30, 25, 0.5);
    animation: fadeIn .2s ease;
}

.modal__sheet {
    position: absolute;
    inset: 0;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    animation: slideUp .3s cubic-bezier(.2,.7,.2,1);
}

@media (min-width: 480px) {
    .modal__sheet {
        max-width: 560px;
        margin: 0 auto;
        border-radius: 28px;
        inset: 32px 0;
        box-shadow: var(--shadow-lg);
        overflow: hidden;
    }
}

@media (min-width: 900px) {
    .modal__sheet {
        max-width: 720px;
        inset: 5vh 0;
    }
}

.modal__head {
    display: flex;
    align-items: center;
    padding: 14px var(--pad);
    background: var(--color-primary);
    color: #fff;
    gap: 10px;
}

    .modal__head .icon-btn {
        background: rgba(255,255,255,0.15);
    }

.modal__title {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    text-align: center;
}

.modal__spacer {
    width: 42px;
}

.modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 20px var(--pad) 28px;
}

/* ---------- Modal helpers ---------- */
.info-card {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 14px;
}

    .info-card p {
        margin: 0 0 10px;
        line-height: 1.8;
    }

        .info-card p:last-child {
            margin-bottom: 0;
        }

    .info-card strong {
        color: var(--color-primary);
    }

.copy-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--color-primary-soft);
    padding: 12px 14px;
    border-radius: 12px;
    font-family: "Vazirmatn", monospace;
    direction: ltr;
    font-size: 16px;
    color: var(--color-primary);
    font-weight: 600;
    margin: 10px 0;
}

    .copy-box button {
        background: var(--color-primary);
        color: #fff;
        border: none;
        padding: 6px 12px;
        border-radius: 8px;
        font-family: inherit;
        cursor: pointer;
        font-size: 13px;
    }

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--color-border);
    gap: 12px;
}

    .stat-row:last-child {
        border-bottom: none;
    }

    .stat-row .label {
        color: var(--color-muted);
        font-size: 14px;
    }

    .stat-row .value {
        font-weight: 700;
        color: var(--color-text);
    }

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tx {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    gap: 12px;
}

.tx__title {
    font-weight: 600;
    font-size: 14px;
}

.tx__date {
    font-size: 12px;
    color: var(--color-muted);
    margin-top: 2px;
}

.tx__amount {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.tx__amount--in {
    color: var(--color-success);
}

.tx__amount--out {
    color: var(--color-danger);
}

.grid--welfare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 520px) {
    .grid--welfare {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .grid--welfare {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.select-item {
    background: #fff;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 15px;
    cursor: pointer;
    text-align: right;
    transition: border-color .2s, background .2s;
    font-family: inherit;
    color: var(--color-text);
    font-weight: 500;
}

    .select-item:hover, .select-item.selected {
        border-color: var(--color-primary);
        background: var(--color-primary-soft);
        color: var(--color-primary);
    }

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
    font-size: 14px;
}

    .checkbox input {
        width: 20px;
        height: 20px;
        accent-color: var(--color-primary);
    }

.success-view {
    text-align: center;
    padding: 30px 10px;
}

.success-view__icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #e6f4ea;
    color: var(--color-success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin-bottom: 14px;
    animation: pop .35s ease;
}

.success-view h3 {
    margin: 8px 0;
    color: var(--color-success);
}

.success-view p {
    color: var(--color-muted);
    margin: 0 0 20px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translate(-50%, 60px);
    background: #222;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    z-index: 200;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

    .toast.show {
        opacity: 1;
        transform: translate(-50%, 0);
    }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    70% {
        transform: scale(1.08);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

/* Small screens */
@media (max-width: 340px) {
    .grid--2 {
        grid-template-columns: 1fr;
    }

    .svc-card {
        min-height: auto;
    }
}
