body {
    margin: 0;
}

.lg {
    --ink: #14231f;
    --ink-soft: #5b6b66;
    --leaf: #123a31;
    --leaf-deep: #0c2923;
    --straw: #f0b429;
    --paper: #f7f8f5;
    --line: #dfe5e0;
    --danger: #c2342b;

    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(360px, 540px) 1fr;
    grid-template-rows: minmax(0, 1fr);
    background: var(--paper);
    color: var(--ink);
    font-family: inherit;
}

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

.lg input, .lg button {
    font-family: inherit;
}

/* ───────── ستون فرم ───────── */
.lg-form-side {
    display: flex;
    flex-direction: column;
    padding: 32px clamp(24px, 5vw, 64px);
}

.lg-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--leaf);
    font-weight: 800;
    font-size: 22px;
    text-decoration: none;
}

.lg-brand svg {
    width: 34px;
    height: 34px;
}

.lg-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 0;
}

.lg-main h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.5;
    margin: 0 0 10px;
    color: var(--ink);
}

.lg-main .lg-sub {
    margin: 0 0 32px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 2;
}

.lg-main .lg-sub bdi {
    color: var(--ink);
    font-weight: 700;
    letter-spacing: .5px;
}

/* فیلد شماره */
.lg-field label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}

.lg-phone {
    display: flex;
    align-items: center;
    direction: ltr;
    height: 58px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    transition: border-color .15s, box-shadow .15s;
    overflow: hidden;
}

.lg-phone:focus-within {
    border-color: var(--leaf);
    box-shadow: 0 0 0 4px rgba(18, 58, 49, .12);
}

.lg-phone.is-invalid {
    border-color: var(--danger);
}

.lg-phone.is-invalid:focus-within {
    box-shadow: 0 0 0 4px rgba(194, 52, 43, .14);
}

.lg-phone .lg-cc {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: #eef2ee;
    border-right: 1.5px solid var(--line);
    color: var(--ink-soft);
    font-size: 15px;
    font-weight: 700;
    user-select: none;
}

.lg .lg-phone input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0 16px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--ink);
    box-shadow: none;
}

.lg .lg-phone input::placeholder {
    color: #b3bdb8;
    font-weight: 400;
    letter-spacing: 1.5px;
}

/* فیلدهای ایمیل و رمز (تب ورود با ایمیل) */
.lg .lg-phone.is-email input {
    font-size: 16px;
    letter-spacing: 0;
}

.lg .lg-phone.is-email input::placeholder {
    letter-spacing: 0;
}

/* کد ۶ رقمی */
.lg-otp {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    direction: ltr;
}

.lg .lg-otp input {
    width: 100%;
    height: 64px;
    padding: 0;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    outline: 0;
    box-shadow: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}

.lg .lg-otp input:focus {
    border-color: var(--leaf);
    box-shadow: 0 0 0 4px rgba(18, 58, 49, .12);
    transform: translateY(-2px);
}

.lg .lg-otp input.is-filled {
    border-color: var(--leaf);
    background: #f1f6f3;
}

.lg-otp.is-invalid input {
    border-color: var(--danger);
    background: #fff;
}

.lg-otp.is-invalid {
    animation: lg-shake .4s;
}

@keyframes lg-shake {
    20% {
        transform: translateX(-6px);
    }
    40% {
        transform: translateX(6px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
}

.lg-error {
    display: block;
    margin-top: 10px;
    color: var(--danger);
    font-size: 13.5px;
    line-height: 1.8;
}

/* دکمه */
.lg .lg-btn {
    width: 100%;
    height: 58px;
    margin-top: 24px;
    border: 0;
    border-radius: 14px;
    background: var(--leaf);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    transition: background .15s, transform .15s, box-shadow .15s;
}

.lg .lg-btn:hover {
    background: var(--leaf-deep);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px -10px rgba(12, 41, 35, .6);
}

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

.lg .lg-btn:focus-visible {
    outline: 3px solid var(--straw);
    outline-offset: 3px;
}

.lg .lg-btn.is-loading {
    pointer-events: none;
    opacity: .85;
    color: transparent;
}

.lg .lg-btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lg-spin .7s linear infinite;
}

@keyframes lg-spin {
    to {
        transform: rotate(360deg);
    }
}

.lg-back {
    display: inline-block;
    margin-top: 18px;
    color: var(--ink-soft);
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    padding-bottom: 2px;
}

.lg-back:hover {
    color: var(--leaf);
}

.lg-foot {
    color: #8a9893;
    font-size: 12.5px;
    line-height: 2;
}

.lg-foot a {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

/* ───────── ستون برند ───────── */
.lg-panel {
    position: relative;
    overflow: hidden;
    background: var(--leaf);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(24px, min(5vw, 6vh), 72px);
    min-height: 0;
    isolation: isolate;
}

/* بافت حصیر */
.lg-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.5'%3E%3Crect x='2' y='2' width='20' height='9' rx='2'/%3E%3Crect x='2' y='13' width='20' height='9' rx='2'/%3E%3Crect x='26' y='2' width='9' height='20' rx='2'/%3E%3Crect x='37' y='2' width='9' height='20' rx='2'/%3E%3Crect x='2' y='26' width='9' height='20' rx='2'/%3E%3Crect x='13' y='26' width='9' height='20' rx='2'/%3E%3Crect x='26' y='26' width='20' height='9' rx='2'/%3E%3Crect x='26' y='37' width='20' height='9' rx='2'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 48px 48px;
}

.lg-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(90% 70% at 50% 100%, rgba(6, 22, 18, .6) 0%, transparent 70%);
}

.lg-copy {
    max-width: 460px;
}

.lg-copy h2 {
    margin: 0 0 16px;
    font-size: clamp(26px, min(3.8vw, 6vh), 52px);
    font-weight: 900;
    line-height: 1.45;
    color: #fff;
}

.lg-copy p {
    margin: 0;
    font-size: 16px;
    line-height: 2.1;
    color: rgba(255, 255, 255, .75);
}

/* سبد همیشه در فضای باقی‌مانده‌ی پنل جا می‌شود (روی هر ارتفاع مانیتور) */
.lg-scene-wrap {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 600px;
    align-self: center;
}

.lg-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

.lg-scene .it {
    animation: lg-rise .8s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: var(--d, 0s);
}

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

/* ارسال مجدد */
.lg-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.lg-row .lg-back {
    margin-top: 0;
}

.lg-resend {
    font-size: 14px;
    color: var(--ink-soft);
}

.lg-resend bdi {
    font-weight: 800;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.lg .lg-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--leaf);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    border-bottom: 1px solid currentColor;
}

.lg .lg-link:focus-visible {
    outline: 3px solid var(--straw);
    outline-offset: 3px;
}

/* ───────── تب‌های ورود (موبایل / ایمیل) ───────── */
.lg-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 28px;
    background: #eef2ee;
    border-radius: 14px;
}

.lg .lg-tab {
    height: 46px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.lg .lg-tab.is-active {
    background: #fff;
    color: var(--leaf);
    box-shadow: 0 2px 8px -2px rgba(18, 58, 49, .2);
}

.lg .lg-tab:focus-visible {
    outline: 3px solid var(--straw);
    outline-offset: 2px;
}

.lg-hint {
    margin: 18px 0 0;
    font-size: 14px;
    line-height: 2;
    color: var(--ink-soft);
}

/* ───────── ریسپانسیو ───────── */
/* دسکتاپ: صفحه دقیقاً به اندازه‌ی ارتفاع مانیتور است و سبد هیچ‌وقت پایین‌تر از صفحه نمی‌ماند */
@media (min-width: 901px) {
    .lg {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
    }

    .lg-form-side {
        overflow-y: auto;
        min-height: 0;
    }

    .lg-panel {
        overflow: hidden;
    }
}

/* مانیتور/لپ‌تاپ کوتاه: متن توضیحی حذف می‌شود تا جا برای سبد بماند */
@media (min-width: 901px) and (max-height: 720px) {
    .lg-copy p {
        display: none;
    }

    .lg-copy h2 {
        margin-bottom: 0;
    }
}

/* تبلت و موبایل: نوار برند سبز با سبد در بالا، فرم روی آن مثل کارت می‌نشیند */
@media (max-width: 900px) {
    .lg {
        display: flex;
        flex-direction: column;
        background: var(--leaf);
    }

    .lg-panel {
        display: flex;
        order: -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 26px 22px 58px;
    }

    .lg-copy {
        max-width: none;
    }

    .lg-copy h2 {
        margin: 0;
        font-size: clamp(20px, 6vw, 28px);
        line-height: 1.7;
        text-wrap: balance;
    }

    .lg-copy p {
        display: none;
    }

    .lg-scene-wrap {
        flex: 0 0 auto;
        width: clamp(112px, 34vw, 160px);
        height: clamp(88px, 27vw, 126px);
    }

    .lg-form-side {
        flex: 1;
        position: relative;
        z-index: 1;
        margin-top: -30px;
        padding: 26px 22px 20px;
        background: var(--paper);
        border-radius: 28px 28px 0 0;
    }

    /* فرم نزدیک بالا می‌ماند تا با باز شدن کیبورد موبایل زیر آن نرود */
    .lg-main {
        justify-content: flex-start;
        padding: 30px 0 22px;
    }

    .lg-main h1 {
        font-size: 24px;
    }

    .lg-main .lg-sub {
        margin-bottom: 24px;
    }
}

@media (max-width: 400px) {
    .lg-otp {
        gap: 6px;
    }

    .lg .lg-otp input {
        height: 56px;
        font-size: 22px;
    }

    .lg .lg-tab {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lg *, .lg *::before, .lg *::after {
        animation: none !important;
        transition: none !important;
    }

    .lg-handle path {
        stroke-dashoffset: 0;
    }
}