:root {
    --ink: #1a315e;
    --steel: #1F6F78;
    --steel-light: #2C8C93;
    --amber: #E8A33D;
    --paper: #F6F4EF;
    --line: #93A4AD;
    --success: #3F8F5F;
    --danger: #C1594A;
    --text: #1B2430;
    --text-muted: #5B6B75;
    --radius: 14px;
    --font-display: 'Vazirmatn', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-display);
    background: var(--ink);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

a , a:visited
{
    color:#fff;
    text-decoration:none;
}

    a:hover {
        color: #ffaf0b;
    }
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 40%, transparent 90%);
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 20px 72px;
}

/* ---------- Masthead ---------- */
.masthead {
    text-align: center;
    margin-bottom: 36px;
    color: #EDEEF0;
}

.masthead__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 18px;
}

.mark-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(232,163,61,0.18);
}

.mark-line {
    width: 56px;
    height: 1px;
    background: linear-gradient(90deg, var(--amber), transparent);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--amber);
    text-transform: uppercase;
    margin: 0 0 10px;
    direction: ltr;
}

h1 {
    font-size: clamp(22px,4vw,30px);
    font-weight: 800;
    margin: 0 0 10px;
    line-height: 1.4;
}

.sub {
    margin: 0;
    color: #AEB6BE;
    font-size: 14.5px;
    line-height: 1.8;
    max-width: 440px;
    margin-inline: auto;
}

/* ---------- Card ---------- */
.card {
    position: relative;
    background: var(--paper);
    border-radius: var(--radius);
    padding: 32px 28px 28px;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,0.55);
}

.card__corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: var(--amber);
    border-style: solid;
    opacity: 0.7;
}

.card__corner--tl {
    top: 14px;
    right: 14px;
    border-width: 2px 2px 0 0;
}

.card__corner--br {
    bottom: 14px;
    left: 14px;
    border-width: 0 0 2px 2px;
}

.section {
    margin-bottom: 8px;
}

.section__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.section__tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--steel);
    border: 1px solid var(--steel);
    border-radius: 6px;
    padding: 2px 7px;
    line-height: 1.6;
}

.section__head h2 {
    font-size: 16px;
    margin: 0 0 3px;
    font-weight: 700;
}

.section__head p {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted);
}

/* ---------- Fields ---------- */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.field {
    position: relative;
    margin-bottom: 16px;
}

    .field input,
    .field select {
        width: 100%;
        font-family: var(--font-display);
        font-size: 15px;
        color: var(--text);
        background: #fff;
        border: 1.5px solid #DDE2E5;
        border-radius: 10px;
        padding: 18px 14px 8px;
        outline: none;
        transition: border-color .15s ease, box-shadow .15s ease;
        appearance: none;
    }

.field--mono input {
    font-family: var(--font-mono);
    direction: ltr;
    text-align: right;
}

.field select {
    cursor: pointer;
}

.field--select::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 22px;
    width: 8px;
    height: 8px;
    border-left: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(-45deg);
    pointer-events: none;
}

.field label {
    position: absolute;
    right: 14px;
    top: 16px;
    font-size: 15px;
    color: var(--text-muted);
    pointer-events: none;
    transition: all .15s ease;
    background: transparent;
}

.field input:focus,
.field select:focus {
    border-color: var(--steel);
    box-shadow: 0 0 0 3px rgba(31,111,120,0.14);
}

    .field input:focus ~ label,
    .field input:not(:placeholder-shown) ~ label,
    .field select:focus ~ label,
    .field select:valid ~ label {
        top: 6px;
        font-size: 11px;
        color: var(--steel);
        font-weight: 600;
    }

.field select:invalid ~ label {
    top: 16px;
    font-size: 15px;
}

.req {
    color: var(--amber);
    font-weight: 700;
}

.field__msg {
    margin: 5px 2px 0;
    font-size: 12px;
    color: var(--text-muted);
    min-height: 15px;
    transition: color .15s ease;
}

.field.is-valid input {
    border-color: var(--success);
}

.field.is-valid .field__msg {
    color: var(--success);
}

.field.is-invalid input {
    border-color: var(--danger);
}

.field.is-invalid .field__msg {
    color: var(--danger);
}

.field__icon {
    position: absolute;
    left: 14px;
    top: 16px;
    width: 18px;
    height: 18px;
}

.field.is-valid .field__icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--success);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
}

.field.is-invalid .field__icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--danger);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3'%3E%3Cpath d='M18 6L6 18M6 6l12 12'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* password peek */
.peek {
    position: absolute;
    left: 12px;
    top: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .peek svg {
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .peek[data-active="true"] .ic-eye {
        display: none;
    }

    .peek[data-active="true"] .ic-eye-off {
        display: block !important;
    }

/* strength meter */
.strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

    .strength span {
        height: 4px;
        flex: 1;
        border-radius: 2px;
        background: #E3E7E9;
        transition: background .2s ease;
    }

.strength__label {
    margin: 4px 2px 0;
    font-size: 11.5px;
    color: var(--text-muted);
    min-height: 14px;
}

/* ---------- Optional toggle ---------- */
.toggle-optional {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #EEF2EE;
    border: 1.5px dashed #C7CFC9;
    border-radius: 10px;
    padding: 13px 14px;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
    margin: 18px 0 6px;
    transition: background .15s ease;
}

    .toggle-optional:hover {
        background: #E6ECE6;
    }

.section__tag--ghost {
    border-color: var(--line);
    color: var(--text-muted);
    flex-shrink: 0;
}

.toggle-optional__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .toggle-optional__text strong {
        font-size: 14px;
    }

    .toggle-optional__text small {
        font-size: 12px;
        color: var(--text-muted);
        font-weight: 400;
    }

.chev {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
    flex-shrink: 0;
}

.toggle-optional[aria-expanded="true"] .chev {
    transform: rotate(180deg);
}

.section--optional {
    padding-top: 6px;
    animation: reveal .22s ease;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

/* ---------- Captcha ---------- */
.captcha {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 16px;
}

    .captcha canvas {
        flex: 1;
        border: 1.5px solid #DDE2E5;
        border-radius: 10px;
        background: #EEF1F0;
        cursor: default;
        max-width: 100%;
        height: 64px;
    }

.captcha__refresh {
    flex-shrink: 0;
    width: 52px;
    border: 1.5px solid #DDE2E5;
    border-radius: 10px;
    background: #fff;
    color: var(--steel);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .3s ease, border-color .15s ease;
}

    .captcha__refresh:hover {
        background: #EEF2EE;
        border-color: var(--steel);
    }

    .captcha__refresh:active svg {
        transform: rotate(180deg);
    }

    .captcha__refresh svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
        transition: transform .3s ease;
    }

/* ---------- Submit ---------- */
.submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    padding: 16px;
    border: none;
    border-radius: 10px;
    background: var(--steel);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}

    .submit svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.2;
        stroke-linecap: round;
        stroke-linejoin: round;
        transform: scaleX(-1);
    }

    .submit:not(:disabled):hover {
        background: var(--steel-light);
        box-shadow: 0 8px 20px -8px rgba(31,111,120,0.6);
    }

    .submit:not(:disabled):active {
        transform: scale(0.99);
    }

    .submit:disabled {
        background: #C9CFD2;
        cursor: not-allowed;
    }

.footnote {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin: 16px 0 0;
}

    .footnote a {
        color: var(--steel);
        text-decoration: none;
        font-weight: 600;
    }

        .footnote a:hover {
            text-decoration: underline;
        }

/* ---------- Responsive ---------- */
@media (max-width:520px) {
    .field-row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 26px 18px 22px;
    }
}

/* ---------- Accessibility ---------- */
:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
