﻿*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body.lgn {
    font-family: var(--ds-font);
    font-size: 15px;
    color: var(--ds-ink);
    background: var(--ds-surface);
}

.lgn-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

.lgn-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 28px;
    background: var(--ds-surface);
}

.lgn-form__wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 28px; }

.lgn-kicker { display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 999px; background: var(--sl-brand-soft, #fff1e8); color: var(--sl-brand, #f5620e); font-size: 12.5px; font-weight: 800; letter-spacing: .5px; }
.lg-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; color: var(--sl-brand-deep, #0a2559); }
.lg-head p { margin: 0; font-size: 14.5px; color: var(--ds-muted); line-height: 1.7; }

.lgn-brand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background-color: #f4f6fa;
    background-image: linear-gradient(#e7ebf2 1px, transparent 1px), linear-gradient(90deg, #e7ebf2 1px, transparent 1px);
    background-size: 44px 44px;
    border-inline-start: 1px solid var(--ds-line);
    overflow: hidden;
}

.lgn-brand__inner { width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.lgn-flag { display: block; width: min(420px, 100%); }
.lgn-wordmark { display: block; width: min(300px, 70%); height: auto; }

.lgn-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; border-top: 1px solid var(--ds-line); font-size: 12.5px; color: var(--ds-muted); }
.lgn-foot a { color: var(--sl-brand-deep, #0a2559); font-weight: 700; text-decoration: none; }

.lg-form { display: flex; flex-direction: column; gap: 22px; }

.lg-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--ds-danger-soft);
    color: var(--ds-danger);
    font-weight: 700;
}

.lg-alert i { font-size: 22px; }

.lg-field { display: flex; flex-direction: column; gap: 7px; }
.lg-field > label { font-size: 13px; font-weight: 600; color: var(--ds-muted); }

.lg-input {
    position: relative;
    display: flex;
    align-items: center;
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background: var(--ds-bg);
    transition: border-color .15s ease, background-color .15s ease;
}

.lg-input:focus-within { border-color: var(--ds-primary); background: var(--ds-surface); }

.lg-field .pw input {
    height: 52px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background: var(--ds-bg);
    font-size: 16px;
    font-weight: 600;
}
.lg-field .pw input:focus { border-color: var(--ds-primary); background: var(--ds-surface); box-shadow: none; }
.lg-field .pw.is-error input { border-color: var(--ds-danger); }
.lg-field .pw input::placeholder { color: var(--ds-faint); font-weight: 400; text-align: right; direction: rtl; }

.lg-input input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--ds-ink);
}

.lg-input input::placeholder { color: var(--ds-faint); font-weight: 400; }


.lg-error:empty { display: none; }
.lg-error { font-size: 13px; font-weight: 700; color: var(--ds-danger); }
.input-validation-error { color: var(--ds-danger); }
.lg-input:has(.input-validation-error) { border-color: var(--ds-danger); }


.lg-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ds-muted); user-select: none; }
.lg-check input { position: absolute; opacity: 0; pointer-events: none; }

.lg-check__box {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 1.5px solid var(--ds-line-strong);
    border-radius: 6px;
    background: var(--ds-surface);
    color: transparent;
    font-size: 14px;
    transition: background .15s ease, border-color .15s ease;
}

.lg-check input:checked + .lg-check__box { background: var(--ds-primary); border-color: var(--ds-primary); color: #fff; }
.lg-check input:focus-visible + .lg-check__box { box-shadow: 0 0 0 4px rgba(10, 37, 89, .12); }

.lg-submit {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    border: 0;
    border-radius: 12px;
    background: var(--ds-btn-primary-bg, var(--ds-primary));
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease;
}

.lg-submit:hover { background: var(--ds-btn-primary-hover, var(--ds-primary-hover)); }
.lg-submit i { font-size: 20px; transition: transform .15s ease; }
.lg-submit:hover i { transform: translateX(-4px); }
.lg-submit.is-busy { pointer-events: none; opacity: .85; }
.lg-submit.is-busy i { animation: lg-spin .8s linear infinite; }
.lg-submit.is-busy i::before { content: "\f110"; }

@keyframes lg-spin { to { transform: rotate(-360deg); } }

.lg-field > label { color: var(--ds-ink); font-weight: 700; }
.lg-input { height: 50px; gap: 10px; border: 1px solid var(--ds-line); background: var(--ds-surface); }
.lg-input > i { font-size: 20px; color: var(--ds-faint); }
.lg-input:focus-within { border-color: var(--sl-brand, #f5620e); outline: 3px solid rgba(245, 98, 14, .12); }
.lg-field .pw input { height: 50px; border: 1px solid var(--ds-line); background: var(--ds-surface); }
.lg-field .pw input:focus { border-color: var(--sl-brand, #f5620e); outline: 3px solid rgba(245, 98, 14, .12); }
.lg-check input:checked + .lg-check__box { background: var(--sl-brand, #f5620e); border-color: var(--sl-brand, #f5620e); }
.lg-submit { height: 52px; background: var(--sl-brand, #f5620e); font-weight: 800; }
.lg-submit:hover { background: var(--sl-brand-hover, #dd5409); }

@media (max-width: 900px) {
    .lgn-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
    .lgn-brand { order: -1; padding: 28px 20px 18px; border-inline-start: 0; border-bottom: 1px solid var(--ds-line); }
    .lgn-brand__inner { flex-direction: row; justify-content: center; gap: 16px; }
    .lgn-flag { width: 120px; }
    .lgn-wordmark { width: 150px; }
    .lgn-form { align-items: flex-start; padding: 28px 20px 32px; }
    .lg-head h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .lg-submit i { transition: none; }
}
