﻿@font-face {
    font-family: "Yekan";
    src: url("../nmotor-proforma/fonts/iranyekanweblightfanum.woff") format("woff");
    font-weight: 400;
    font-display: swap;
}

:root {
    --ink: #14211c;
    --muted: #5d6b64;
    --paper: #f4f1ea;
    --card: #fffdf8;
    --line: rgba(20, 33, 28, 0.12);
    --green: #1b6b49;
    --green-deep: #0e3b28;
    --brass: #d7b15e;
    --danger: #9f2d2d;
    --night: #0d1411;
    --night-2: #18211d;
    --shadow: 0 18px 50px rgba(16, 24, 20, 0.18);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.mc-body {
    font-family: "Yekan", Tahoma, sans-serif;
    color: var(--ink);
    background: var(--paper);
    direction: rtl;
    height: var(--mc-vh, 100svh);
    overflow: hidden;
}

button, input { font-family: inherit; }

.mc-shell {
    width: min(480px, 100%);
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    position: relative;
    background: var(--paper);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mc-top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 64px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    background: rgba(244, 241, 234, 0.92);
    backdrop-filter: blur(10px);
}

.mc-shell.is-dark .mc-top {
    background: #0d1411;
    color: #f6f3ec;
}

.mc-icon-btn {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.mc-shell:not(.is-dark) .mc-icon-btn {
    background: #fff;
    box-shadow: 0 1px 0 var(--line);
}

.mc-top h1 {
    flex: 1;
    margin: 0;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.mc-screen {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}
.mc-screen.mc-dark { overflow: hidden; }
.mc-screen[hidden] { display: none !important; }

.mc-dark {
    background: var(--night);
    color: #f6f3ec;
}

.mc-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    background: #000;
    overflow: hidden;
}

.mc-stage video,
.mc-stage img,
#qr-reader,
#qr-reader video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

#qr-reader { overflow: hidden; }
#qr-reader__dashboard,
#qr-reader__dashboard_section { display: none !important; }

.mc-frame {
    position: absolute;
    left: 18px;
    right: 18px;
    top: 16%;
    height: 28%;
    border-radius: 18px;
    box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.38);
    border: 1.5px solid rgba(215, 177, 94, 0.9);
    pointer-events: none;
}

.mc-frame span {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid var(--brass);
}

.mc-frame span:nth-child(1) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.mc-frame span:nth-child(2) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.mc-frame span:nth-child(3) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.mc-frame span:nth-child(4) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }

.mc-sheet {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, 0.96);
    color: var(--ink);
    border-radius: 22px;
    padding: 14px;
    box-shadow: var(--shadow);
}

.mc-banner {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f3ead2;
    color: #5c4816;
    font-size: 13px;
    line-height: 1.6;
}

.mc-field {
    display: flex;
    gap: 8px;
}

.mc-field input {
    flex: 1;
    min-width: 0;
    height: 52px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 0 14px;
    font-size: 16px;
    direction: ltr;
    text-align: left;
}

.mc-btn {
    height: 52px;
    border: 0;
    border-radius: 14px;
    padding: 0 16px;
    background: var(--green);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.mc-btn.block { width: 100%; }
.mc-btn.ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--line);
}
.mc-btn.danger { background: var(--danger); }
.mc-btn:disabled { opacity: 0.45; }

.mc-pad { padding: 8px 16px 24px; }

.mc-card {
    background: var(--card);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.mc-kicker {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e7f3ec;
    color: var(--green-deep);
    font-size: 12px;
}

.mc-card h2 {
    margin: 12px 0 6px;
    font-size: 26px;
    line-height: 1.45;
    font-weight: 400;
}

.mc-part {
    margin: 0 0 14px;
    direction: ltr;
    text-align: right;
    color: var(--muted);
    font-size: 15px;
}

.mc-thumbs, .mc-strip, .mc-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.mc-thumbs img, .mc-grid img, .mc-strip img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 14px;
    background: #ece7dc;
}

.mc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    overflow: visible;
}

.mc-grid button {
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 16px;
    overflow: hidden;
}

.mc-grid img { width: 100%; height: auto; aspect-ratio: 1; }

.mc-actions { display: grid; gap: 8px; margin-top: 16px; }

.mc-choice {
    width: 100%;
    text-align: right;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 8px;
    cursor: pointer;
}

.mc-choice strong { display: block; font-weight: 400; font-size: 16px; }
.mc-choice span { color: var(--muted); direction: ltr; display: block; margin-top: 4px; }

.mc-square-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
}

.mc-square {
    width: min(100%, 78vw, 420px);
    max-height: 100%;
    aspect-ratio: 1;
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    background: #000;
    box-shadow: 0 0 0 1px rgba(215, 177, 94, 0.45);
}

.mc-square video, .mc-square img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mc-dock {
    position: relative;
    flex-shrink: 0;
    z-index: 4;
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
    background: #0d1411;
}

.mc-shutter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.mc-shutter {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 4px solid #fff;
    background: radial-gradient(circle at 50% 50%, #fff 0 58%, var(--brass) 60% 100%);
    cursor: pointer;
}

.mc-mini {
    min-width: 92px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
}

.mc-strip { min-height: 76px; }
.mc-shot {
    position: relative;
    flex: 0 0 auto;
}
.mc-shot button {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    cursor: pointer;
}

.mc-review-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mc-process { padding-top: 8px; }
.mc-process p { margin: 0 0 12px; color: var(--muted); }
.mc-process-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.mc-job-tile small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}
.mc-job-frame {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #111;
    aspect-ratio: 1;
}
.mc-job-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mc-job-tile.is-pending .mc-job-frame::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.28);
}
.mc-job-progress {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 28px;
    height: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 99px;
    z-index: 1;
}
.mc-job-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: #2dce89;
}
.mc-job-frame b {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    z-index: 1;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}
.mc-job-tile.is-ok small { color: var(--green); }
.mc-job-tile.is-bad small { color: var(--danger); }

.mc-drawer {
    position: absolute;
    inset: 0;
    z-index: 8;
    background: rgba(8, 12, 10, 0.45);
}
.mc-drawer[hidden] { display: none !important; }
.mc-drawer-panel {
    width: min(86%, 360px);
    height: 100%;
    margin-inline-end: auto;
    background: var(--paper);
    padding: calc(16px + env(safe-area-inset-top)) 16px 16px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}
.mc-drawer-panel h2 { margin: 8px 0 12px; font-size: 22px; font-weight: 400; }
.mc-jobs { flex: 1; overflow: auto; }
.mc-job {
    width: 100%;
    text-align: right;
    border: 0;
    background: var(--card);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
}
.mc-job strong { display: block; font-weight: 400; }
.mc-job small { color: var(--muted); }

.mc-light {
    position: absolute;
    inset: 0;
    z-index: 9;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.mc-light[hidden] { display: none !important; }
.mc-light img {
    max-width: 100%;
    max-height: 78dvh;
    object-fit: contain;
    border-radius: 12px;
}

.mc-empty {
    color: var(--muted);
    line-height: 1.7;
    padding: 12px 4px;
}

.mc-login {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
    background:
        radial-gradient(120% 60% at 100% 0%, rgba(215, 177, 94, 0.35), transparent 55%),
        var(--paper);
}
.mc-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--green-deep);
    color: var(--brass);
    margin-bottom: 18px;
    font-size: 18px;
}
.mc-login h1 { margin: 0 0 8px; font-size: 30px; font-weight: 400; }
.mc-lead { margin: 0 0 22px; color: var(--muted); line-height: 1.7; }
.mc-login label { display: block; margin-bottom: 8px; }
.mc-login input[type="tel"], .mc-login input[type="text"] {
    width: 100%;
    height: 54px;
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 0 14px;
    font-size: 18px;
    background: #fff;
}
.mc-otp {
    display: flex;
    gap: 8px;
    direction: ltr;
    justify-content: center;
    margin: 8px 0 12px;
}
.mc-otp input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    border-radius: 14px;
    border: 1px solid var(--line);
}
.mc-timer { text-align: center; color: var(--danger); margin-bottom: 12px; font-size: 14px; }
.mc-login .mc-btn { width: 100%; margin-top: 14px; }

@media (min-width: 900px) {
    .mc-shell {
        min-height: 100dvh;
        box-shadow: 0 0 0 1px var(--line);
    }
}
