:root {
    --auth-green: #4a7c59;
    --auth-green-dark: #345f43;
    --auth-green-light: #e6f1e8;
    --auth-ink: #1b2b20;
    --auth-muted: #718077;
    --auth-border: rgba(255, 255, 255, .72);
    --auth-danger: #d94b55;
    --auth-glass: rgba(255, 255, 255, .72);
    --auth-shadow: 0 28px 90px rgba(29, 66, 42, .14), 0 6px 24px rgba(29, 66, 42, .06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #eaf2eb;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 0;
    color: var(--auth-ink);
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(ellipse at 12% 12%, rgba(132, 178, 139, .34), transparent 34%),
        radial-gradient(ellipse at 88% 85%, rgba(116, 164, 128, .28), transparent 36%),
        linear-gradient(135deg, #edf5ee 0%, #e4eee5 48%, #f2f6f0 100%);
    background-attachment: fixed;
    overflow-x: hidden;
}

body,
button,
input {
    font-family: "Vazirmatn", Tahoma, sans-serif;
}

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

button,
input {
    font: inherit;
}

button,
a,
input {
    -webkit-tap-highlight-color: transparent;
}

.auth-page {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow: clip;
    background: transparent;
}

.auth-section {
    position: relative;
    z-index: 0;
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 38px 20px 22px;
    background: transparent;
}

.auth-section--register {
    padding-top: 26px;
    padding-bottom: 20px;
}

.auth-orb {
    position: absolute;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(2px);
}

.auth-orb--one {
    top: 7%;
    left: 8%;
    width: clamp(170px, 25vw, 340px);
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(103, 157, 113, .25), rgba(103, 157, 113, 0) 70%);
}

.auth-orb--two {
    right: 4%;
    bottom: 3%;
    width: clamp(210px, 30vw, 410px);
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(171, 198, 157, .3), rgba(171, 198, 157, 0) 70%);
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(100%, 540px);
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 30px;
    background: var(--auth-glass);
    box-shadow: var(--auth-shadow), inset 0 1px 0 rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    backdrop-filter: blur(24px) saturate(145%);
}

.auth-card--login {
    width: min(100%, 470px);
    padding: 38px 40px 30px;
}

.auth-card--register {
    width: min(100%, 680px);
    padding: 28px 34px 24px;
}

.auth-brand {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 11px;
    margin: 0 auto 23px;
    direction: rtl;
}

.auth-brand__mark {
    display: grid;
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    place-items: center;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: 16px;
    background: linear-gradient(145deg, #76a982, #3f704e);
    box-shadow: 0 8px 18px rgba(67, 119, 79, .23), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.auth-brand__mark svg {
    width: 25px;
    height: 25px;
}

.auth-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.auth-brand__text strong {
    color: #294a32;
    font-size: 16px;
    font-weight: 800;
}

.auth-brand__text small {
    margin-top: 3px;
    color: #7d9281;
    direction: ltr;
    font-family: Arial, sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
}

.auth-header {
    margin-bottom: 25px;
    text-align: center;
}

.auth-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    place-items: center;
    color: var(--auth-green);
    border: 1px solid rgba(74, 124, 89, .15);
    border-radius: 19px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(226, 239, 227, .72));
    box-shadow: 0 8px 22px rgba(62, 111, 74, .08), inset 0 1px 0 #fff;
}

.auth-icon svg {
    width: 26px;
    height: 26px;
}

.auth-header h1 {
    margin: 0;
    color: #243a2a;
    font-size: clamp(21px, 3vw, 25px);
    font-weight: 800;
    letter-spacing: -.5px;
}

.auth-header p {
    max-width: 440px;
    margin: 7px auto 0;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.9;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 14px;
}

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.field>label {
    padding-right: 3px;
    color: #344c39;
    font-size: 12px;
    font-weight: 700;
}

.field-control {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
}

.field-icon {
    position: absolute;
    right: 15px;
    z-index: 1;
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    color: #7c9a82;
    pointer-events: none;
}

.field-icon svg {
    width: 19px;
    height: 19px;
}

.field-control input {
    display: block;
    width: 100%;
    height: 51px;
    min-width: 0;
    padding: 0 45px 0 15px;
    color: #273c2d;
    border: 1px solid rgba(106, 139, 112, .2);
    border-radius: 16px;
    outline: none;
    background: rgba(255, 255, 255, .64);
    box-shadow: inset 0 1px 2px rgba(35, 71, 43, .025), 0 2px 8px rgba(35, 71, 43, .025);
    font-size: 12px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}

.field-control input::placeholder {
    color: #a0afa3;
    opacity: 1;
}

.field-control input:focus {
    border-color: rgba(74, 124, 89, .68);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 0 0 4px rgba(74, 124, 89, .1), 0 5px 16px rgba(48, 95, 59, .06);
}

.field-control input[dir="ltr"] {
    text-align: left;
    padding-right: 15px;
    padding-left: 45px;
}

.field-hint {
    margin-top: -3px;
    padding-right: 3px;
    color: #8a9b8e;
    font-size: 10px;
}

.field-error,
.field>span[data-valmsg-for] {
    min-height: 0;
    color: var(--auth-danger);
    font-size: 10px;
    line-height: 1.5;
}

.field-error:empty,
.field>span[data-valmsg-for]:empty {
    display: none;
}

.validation-summary-errors {
    padding: 10px 13px;
    color: #a6323e;
    border: 1px solid rgba(217, 75, 85, .18);
    border-radius: 13px;
    background: rgba(255, 238, 239, .78);
    font-size: 11px;
}

.validation-summary-errors:empty {
    display: none;
}

.validation-summary-errors ul {
    margin: 0;
    padding: 0 17px 0 0;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -2px;
}

.checkbox,
.terms {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #627467;
    cursor: pointer;
    font-size: 11px;
}

.checkbox input,
.terms input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.checkbox__visual {
    position: relative;
    display: inline-grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
    border: 1px solid rgba(91, 126, 98, .35);
    border-radius: 6px;
    background: rgba(255, 255, 255, .8);
    transition: .2s ease;
}

.checkbox input:checked+.checkbox__visual,
.terms input:checked+.checkbox__visual {
    border-color: var(--auth-green);
    background: var(--auth-green);
}

.checkbox input:checked+.checkbox__visual::after,
.terms input:checked+.checkbox__visual::after {
    width: 8px;
    height: 5px;
    border-bottom: 2px solid #fff;
    border-left: 2px solid #fff;
    content: "";
    transform: rotate(-45deg) translate(1px, -1px);
}

.checkbox input:focus-visible+.checkbox__visual,
.terms input:focus-visible+.checkbox__visual {
    outline: 3px solid rgba(74, 124, 89, .18);
    outline-offset: 2px;
}

.support-note {
    color: #7d9b82;
    font-size: 10px;
    white-space: nowrap;
}

.btn-submit {
    display: flex;
    width: 100%;
    min-height: 53px;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 3px;
    padding: 10px 18px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 16px;
    background: linear-gradient(120deg, #5b9168 0%, #3f714d 55%, #345f43 100%);
    box-shadow: 0 10px 22px rgba(59, 111, 71, .22), inset 0 1px 0 rgba(255, 255, 255, .22);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.btn-submit svg {
    width: 19px;
    height: 19px;
    transition: transform .2s ease;
}

.btn-submit:hover {
    filter: brightness(1.06);
    box-shadow: 0 13px 27px rgba(59, 111, 71, .27), inset 0 1px 0 rgba(255, 255, 255, .25);
    transform: translateY(-2px);
}

.btn-submit:hover svg {
    transform: translateX(-3px);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:focus-visible,
.btn-outline-full:focus-visible,
.auth-brand:focus-visible {
    outline: 3px solid rgba(74, 124, 89, .28);
    outline-offset: 3px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 13px;
    margin: 20px 0 15px;
    color: #91a094;
    font-size: 10px;
    white-space: nowrap;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    background: rgba(100, 133, 106, .18);
    content: "";
}

.btn-outline-full {
    display: flex;
    width: 100%;
    min-height: 47px;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    color: var(--auth-green-dark);
    border: 1px solid rgba(74, 124, 89, .27);
    border-radius: 15px;
    background: rgba(255, 255, 255, .46);
    font-size: 12px;
    font-weight: 700;
    transition: .2s ease;
}

.btn-outline-full:hover {
    border-color: rgba(74, 124, 89, .55);
    background: rgba(255, 255, 255, .82);
    transform: translateY(-1px);
}

.auth-footnote {
    margin: 18px 0 0;
    color: #8b9a8f;
    font-size: 10px;
    text-align: center;
}

.terms {
    align-items: flex-start;
    margin-top: 1px;
    line-height: 1.9;
}

.terms__text a {
    color: var(--auth-green-dark);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(74, 124, 89, .35);
    text-underline-offset: 3px;
}

.terms__text a:hover {
    text-decoration-color: currentColor;
}

.terms-error {
    margin-top: -12px;
    padding-right: 27px;
}

.auth-benefits {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 21px;
    margin-top: 19px;
    padding-top: 17px;
    border-top: 1px solid rgba(100, 133, 106, .15);
}

.auth-benefit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #728477;
    font-size: 10px;
    white-space: nowrap;
}

.auth-benefit svg {
    width: 16px;
    height: 16px;
    color: #6f9877;
}

.auth-copyright {
    position: relative;
    z-index: 1;
    margin-top: 17px;
    color: rgba(69, 96, 74, .68);
    font-size: 10px;
    text-align: center;
}

/* Keep the page background continuous, including the area outside main. */
@media (max-width: 640px) {
    .auth-section {
        justify-content: center;
        padding: 22px 14px 16px;
    }

    .auth-section--register {
        padding-top: 18px;
        padding-bottom: 14px;
    }

    .auth-card,
    .auth-card--login,
    .auth-card--register {
        width: 100%;
        max-width: 480px;
        padding: 25px 20px 22px;
        border-radius: 25px;
    }

    .auth-brand {
        margin-bottom: 18px;
    }

    .auth-header {
        margin-bottom: 21px;
    }

    .auth-header p {
        font-size: 11px;
    }

    .register-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .auth-form {
        gap: 14px;
    }

    .field-control input {
        height: 49px;
        border-radius: 14px;
    }

    .btn-submit {
        min-height: 51px;
        border-radius: 14px;
    }

    .auth-benefits {
        gap: 9px 15px;
    }

    .auth-copyright {
        margin-top: 12px;
    }
}

@media (max-width: 380px) {
    .auth-section {
        padding-right: 10px;
        padding-left: 10px;
    }

    .auth-card,
    .auth-card--login,
    .auth-card--register {
        padding-right: 16px;
        padding-left: 16px;
        border-radius: 22px;
    }

    .form-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-height: 760px) and (min-width: 641px) {
    .auth-section--register {
        justify-content: flex-start;
        padding-top: 14px;
    }

    .auth-card--register {
        padding-top: 22px;
        padding-bottom: 18px;
    }

    .auth-card--register .auth-brand {
        margin-bottom: 13px;
    }

    .auth-card--register .auth-header {
        margin-bottom: 16px;
    }

    .auth-card--register .auth-icon {
        width: 46px;
        height: 46px;
        margin-bottom: 7px;
        border-radius: 16px;
    }

    .auth-card--register .register-grid {
        gap: 10px 13px;
    }

    .auth-card--register .field-control input {
        height: 46px;
    }

    .auth-card--register .auth-benefits {
        margin-top: 13px;
        padding-top: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.auth-success {
    margin: 0 0 18px;
    padding: 12px 15px;
    color: #285b38;
    border: 1px solid rgba(74, 124, 89, .22);
    border-radius: 14px;
    background: rgba(230, 241, 232, .88);
    font-size: 12px;
    line-height: 1.9;
}