.login {
    display: grid;
    grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.1fr);
    min-height: 100vh;
}

.login__brand {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding: 56px 64px;
    color: #fff;
    background:
        radial-gradient(circle at 15% 110%, rgba(194, 65, 12, .30), transparent 55%),
        linear-gradient(160deg, var(--navy-700) 0%, var(--navy-900) 70%);
    overflow: hidden;
}

.login__brand::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--red-600) 0 50%, var(--navy-700) 50% 100%);
    background-size: 200% 100%;
    animation: beacon 3s linear infinite;
}

@keyframes beacon {
    from { background-position: 0 0; }
    to   { background-position: -200% 0; }
}

.brand { margin: 0; line-height: 0; }
.brand__logo { display: block; width: 100%; max-width: 380px; height: auto; }

.clock { display: flex; flex-direction: column; }
.clock__time {
    font-family: "Consolas", "Cascadia Mono", monospace;
    font-size: 64px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 2px;
}
.clock__date { margin-top: 8px; color: #b9c3d8; text-transform: capitalize; }

.features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}
.features li { display: flex; align-items: center; gap: 12px; color: #dce3f0; }
.features__dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.features__dot--red    { background: var(--red-600); box-shadow: 0 0 10px var(--red-600); }
.features__dot--orange { background: var(--orange); }
.features__dot--blue   { background: var(--blue); }
.features__dot--green  { background: var(--green); }

.brand__legal {
    margin: auto 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: 12px;
    line-height: 1.5;
    color: #8995ad;
}

.login__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 40px 24px;
}

.card {
    width: 100%;
    max-width: 420px;
    padding: 40px 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(11, 20, 38, .08);
}

.card__header { margin-bottom: 24px; }
.card__logo { display: none; margin-bottom: 20px; }
.card__logo img { display: block; width: 200px; height: auto; }
.card__header h2 { margin: 0 0 6px; font-size: 24px; }
.card__header p  { margin: 0; color: var(--text-soft); }

.card__help {
    margin: 20px 0 0;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-soft);
    background: var(--bg);
    border-radius: var(--radius);
}

.field { margin-bottom: 18px; }
.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
}
.field__control { position: relative; }
.field__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    fill: var(--text-soft);
    pointer-events: none;
}
.field input {
    width: 100%;
    height: 46px;
    padding: 0 44px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}
#matricule { text-transform: uppercase; letter-spacing: 1px; }
.field input:focus {
    outline: none;
    border-color: var(--red-600);
    box-shadow: 0 0 0 4px var(--focus);
}
.field input.is-invalid { border-color: var(--red-600); }

.field__toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 6px;
    transform: translateY(-50%);
    cursor: pointer;
}
.field__toggle svg { width: 20px; height: 20px; fill: var(--text-soft); }
.field__toggle[aria-pressed="true"] svg { fill: var(--red-600); }
.field__toggle:focus-visible { outline: 2px solid var(--red-600); }

.field__hint { margin: 6px 0 0; font-size: 12px; }
.field__hint--warn { color: var(--orange); font-weight: 600; }

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 24px;
    font-size: 14px;
}
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--red-600); }

.btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    font: inherit;
    font-weight: 700;
    letter-spacing: .3px;
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn--primary { color: #fff; background: var(--red-600); }
.btn--primary:hover { background: var(--red-700); }
.btn--primary:active { transform: translateY(1px); }
.btn--primary:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }

.btn__spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.btn.is-loading { pointer-events: none; opacity: .85; }
.btn.is-loading .btn__label { display: none; }
.btn.is-loading .btn__spinner { display: block; }

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

.footer { font-size: 12px; color: var(--text-soft); text-align: center; }
.footer strong { color: var(--red-600); }

@media (max-width: 900px) {
    .login { grid-template-columns: 1fr; }
    .login__brand { display: none; }
    .card__logo { display: block; }
}

@media (max-width: 480px) {
    .login__panel { padding: 24px 16px; }
    .card { padding: 28px 20px; }
    .row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .login__brand::before, .btn__spinner { animation: none; }
}

.field input.field__plain { padding: 0 14px; }
a.btn { text-decoration: none; }
.btn--secondary { color: var(--text); background: transparent; border: 1px solid var(--border); }
.btn--secondary:hover { border-color: var(--red-600); color: var(--red-600); }

.card--profile { max-width: 640px; padding: 40px 44px 32px; }
.profile__logo img { display: block; width: 240px; height: auto; margin-bottom: 28px; }
.profile__hello { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.profile__question { margin: 0 0 22px; color: var(--text-soft); }

.profiles { display: grid; margin-bottom: 28px; border-top: 1px solid var(--border); }
.profiles__row {
    display: grid;
    grid-template-columns: 36px 52px 64px 110px minmax(0, 1fr);
    align-items: center;
    min-height: 60px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background .12s;
}
.profiles__row:nth-child(even) { background: var(--bg); }
.profiles__row:hover { background: rgba(194, 65, 12, .06); }
.profiles__row:has(input:checked) { background: rgba(194, 65, 12, .10); box-shadow: inset 3px 0 0 var(--red-600); }
.profiles__row input {
    justify-self: center;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--red-600);
    cursor: pointer;
}
.profiles__row input:focus-visible { outline: 2px solid var(--red-600); outline-offset: 2px; }
.profiles__cell {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 8px 10px;
    font-size: 15px;
    border-left: 1px solid var(--border);
}
.profiles__statut { font-weight: 600; }
.profiles__grade { flex-direction: column; justify-content: center; gap: 3px; font-size: 13px; font-weight: 600; }
.profiles__code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 14px; }
.profiles__email { min-width: 0; overflow: hidden; color: var(--text-soft); text-overflow: ellipsis; white-space: nowrap; display: block; line-height: 44px; }

.btn--profile {
    display: flex;
    width: auto;
    min-width: 280px;
    margin: 0 auto;
    padding: 0 32px;
    font-size: 17px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.profile__logout { margin-top: 18px; text-align: center; font-size: 14px; }

@media (max-width: 560px) {
    .card--profile { padding: 28px 18px; }
    .profiles__row { grid-template-columns: 32px 46px 56px minmax(0, 1fr); }
    .profiles__email { display: none; }
    .btn--profile { width: 100%; min-width: 0; }
}
