/* The page an office computer sees until the main manager approves it on the station server. */
@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb.woff2') format('woff2'), url('../fonts/IRANSansWeb.woff') format('woff');
    font-weight: normal;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSansWeb_Bold.woff2') format('woff2'), url('../fonts/IRANSansWeb_Bold.woff') format('woff');
    font-weight: bold;
}

@font-face {
    font-family: 'Bahij Koodak';
    src: url('../fonts/Bahij Koodak-Regular.ttf') format('truetype');
    font-weight: normal;
}

@font-face {
    font-family: 'Bahij Koodak';
    src: url('../fonts/Bahij Koodak-Bold.ttf') format('truetype');
    font-weight: bold;
}

:root {
    --bg: #eef2f8;
    --win: #ffffff;
    --soft: #f5f7fb;
    --ink: #161b33;
    --ink2: #646d82;
    --line: rgba(22, 27, 51, .08);
    --teal: #1f9ab8;
    --green: #1fa971;
    --amber: #d48a0c;
    --red: #d6453a;
    --shadow: 0 30px 70px rgba(30, 40, 80, .14);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1020;
        --win: #151b2d;
        --soft: #1b2236;
        --ink: #eef2fa;
        --ink2: #9aa6bd;
        --line: rgba(255, 255, 255, .07);
        --teal: #4cc6e2;
        --green: #4fd69a;
        --amber: #f0b955;
        --red: #f2857a;
        --shadow: 0 30px 70px rgba(0, 0, 0, .5);
        color-scheme: dark;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 45%),
        var(--bg);
    color: var(--ink);
    font-family: 'IRANSans', system-ui, sans-serif;
}

html[lang="ps"] body {
    font-family: 'Bahij Koodak', 'IRANSans', system-ui, sans-serif;
}

html[lang="en"] body {
    font-family: system-ui, 'Segoe UI', sans-serif;
}

.dv-win {
    position: relative;
    width: 600px;
    max-width: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 28px 34px 32px;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: var(--win);
    box-shadow: var(--shadow);
    text-align: center;
    overflow: hidden;
}

.dv-win::before {
    content: '';
    position: absolute;
    inset: -40% -20% auto auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--teal) 14%, transparent), transparent 70%);
    pointer-events: none;
}

.dv-mini {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: stretch;
    color: var(--ink2);
    font-size: 12.5px;
}

.dv-mini img {
    width: 26px;
    height: 26px;
}

.dv-langs {
    margin-inline-start: auto;
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 12px;
    background: var(--soft);
}

.dv-langs button {
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink2);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.dv-langs button.is-on {
    background: var(--win);
    color: var(--ink);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(30, 40, 80, .1);
}

.dv-step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    animation: dv-rise .5s cubic-bezier(.22, 1, .36, 1) both;
}

.dv-step[hidden] {
    display: none;
}

.dv-step h1 {
    margin: 4px 0 0;
    font-size: 23px;
    font-weight: 800;
}

.dv-step p {
    margin: -4px 0 0;
    max-width: 440px;
    color: var(--ink2);
    font-size: 13.5px;
    line-height: 1.9;
}

.dv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 220px;
    height: 50px;
    padding: 0 24px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #27adcc, #127189);
    color: #fff;
    font: inherit;
    font-size: 14.5px;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(31, 154, 184, .3);
    cursor: pointer;
    transition: transform .2s ease;
}

.dv-btn:hover {
    transform: translateY(-2px);
}

.dv-btn:disabled {
    opacity: .6;
    cursor: default;
}

.dv-btn i {
    color: #fff;
    font-size: 20px;
}

.dv-field {
    display: grid;
    gap: 6px;
    width: 100%;
    max-width: 360px;
    text-align: start;
    color: var(--ink2);
    font-size: 12.5px;
    font-weight: 700;
}

.dv-field input {
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    outline: 0;
    background: var(--soft);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: normal;
}

.dv-field input:focus {
    border-color: var(--teal);
}

/* the computer, the wire and the server */
.dv-link {
    display: flex;
    align-items: center;
}

.dv-node {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    color: #fff;
    font-size: 30px;
}

.dv-node.is-pc {
    background: linear-gradient(145deg, #9d92ff, #5b4bd6);
    box-shadow: 0 12px 24px rgba(107, 92, 231, .3);
}

.dv-node.is-srv {
    background: linear-gradient(145deg, #3cc0de, #127189);
    box-shadow: 0 12px 24px rgba(31, 154, 184, .3);
}

.dv-node.is-bad {
    width: 80px;
    height: 80px;
    font-size: 38px;
    background: linear-gradient(145deg, #f08a7e, #c0392b);
    box-shadow: 0 12px 24px rgba(192, 57, 43, .25);
}

.dv-node.is-off {
    width: 80px;
    height: 80px;
    font-size: 38px;
    background: linear-gradient(145deg, #a3acbf, #6b7489);
    box-shadow: 0 12px 24px rgba(80, 90, 120, .25);
    animation: dv-float 4s ease-in-out infinite;
}

.dv-wire {
    position: relative;
    width: 150px;
    height: 4px;
    margin: 0 10px;
    border-radius: 2px;
    background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink2) 35%, transparent) 0 8px, transparent 8px 14px);
}

.dv-wire i {
    position: absolute;
    top: -4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 12px var(--teal);
    animation: dv-travel 1.8s ease-in-out infinite;
}

.dv-wire i:nth-child(2) {
    animation-delay: .6s;
}

.dv-wire i:nth-child(3) {
    animation-delay: 1.2s;
}

.dv-code {
    display: flex;
    gap: 8px;
}

.dv-code span {
    width: 52px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1.5px solid var(--line);
    background: var(--soft);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 30px;
    font-weight: 800;
    animation: dv-rise .5s cubic-bezier(.22, 1, .36, 1) both;
}

.dv-code .dv-gap {
    width: 14px;
    border: 0;
    background: none;
}

.dv-wait {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--amber) 12%, transparent);
    color: var(--amber);
    font-size: 13px;
    font-weight: 700;
}

.dv-dots i {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 1px;
    border-radius: 50%;
    background: currentColor;
    animation: dv-dot 1.2s ease-in-out infinite;
}

.dv-dots i:nth-child(2) {
    animation-delay: .2s;
}

.dv-dots i:nth-child(3) {
    animation-delay: .4s;
}

.dv-tick svg {
    width: 96px;
    height: 96px;
}

.dv-tick circle {
    fill: color-mix(in srgb, var(--green) 12%, transparent);
    stroke: var(--green);
    stroke-width: 3;
    stroke-dasharray: 280;
    stroke-dashoffset: 280;
    animation: dv-draw .8s ease forwards;
}

.dv-tick path {
    fill: none;
    stroke: var(--green);
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: dv-draw .45s .6s ease forwards;
}

.dv-sleep {
    position: relative;
    width: 110px;
    height: 110px;
    display: grid;
    place-items: center;
}

.dv-z {
    position: absolute;
    top: 4px;
    inset-inline-end: 0;
    color: var(--ink2);
    font-weight: 800;
    animation: dv-zz 2.4s ease-in-out infinite;
}

.dv-z.is-b {
    top: -10px;
    inset-inline-end: -14px;
    font-size: 20px;
    animation-delay: .8s;
}

.dv-retry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink2);
    font-size: 13px;
}

.dv-ring,
.dv-spin {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid color-mix(in srgb, var(--teal) 25%, transparent);
    border-top-color: var(--teal);
    animation: dv-turn 1s linear infinite;
}

.dv-spin {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

.dv-error {
    position: relative;
    margin: 0;
    padding: 9px 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--red) 10%, transparent);
    color: var(--red);
    font-size: 12.5px;
}

@keyframes dv-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

@keyframes dv-travel {
    from {
        right: 0;
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    to {
        right: calc(100% - 12px);
        opacity: 0;
    }
}

@keyframes dv-dot {
    40% {
        transform: translateY(-4px);
        opacity: .4;
    }
}

@keyframes dv-draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes dv-float {
    50% {
        transform: translateY(-5px);
    }
}

@keyframes dv-zz {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-14px);
    }
}

@keyframes dv-turn {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 520px) {
    .dv-win {
        padding: 22px 18px 26px;
    }

    .dv-wire {
        width: 90px;
    }

    .dv-code span {
        width: 40px;
        height: 52px;
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
