:root {
    --bg: #0a0c11;
    --panel: rgba(14, 18, 25, 0.86);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #f4f6fb;
    --muted: #a5adba;
    --accent: #d6a145;
    --accent-soft: rgba(214, 161, 69, 0.14);
    --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

:root[data-theme="light"] {
    --bg: #eef2f7;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-border: rgba(68, 84, 111, 0.14);
    --text: #1a2535;
    --muted: #617189;
    --accent: #bf8d45;
    --accent-soft: rgba(191, 141, 69, 0.12);
    --shadow: 0 18px 42px rgba(75, 94, 126, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body.login-page {
    position: relative;
    background:
        radial-gradient(circle at 18% 14%, rgba(214, 161, 69, 0.08), transparent 24%),
        linear-gradient(180deg, #090b10 0%, #0d1017 100%);
    color: var(--text);
    font-family: "Public Sans", sans-serif;
}

:root[data-theme="light"] body.login-page {
    background:
        radial-gradient(circle at 18% 14%, rgba(214, 161, 69, 0.1), transparent 24%),
        linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
}

.history-nav {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(8, 12, 18, 0.94);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.history-nav__button {
    width: 42px;
    height: 52px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

.history-nav__button + .history-nav__button {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.history-nav__button:hover,
.history-nav__button:focus-visible {
    background: rgba(14, 18, 26, 0.98);
    outline: none;
}

.history-nav__button:active {
    background: linear-gradient(180deg, #b28a4d 0%, #9a733c 100%);
}

.history-nav__button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.login-top-actions {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(14, 18, 25, 0.82);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    color: var(--text);
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: rgba(184, 138, 71, 0.4);
    background: rgba(14, 18, 26, 0.98);
    outline: none;
    transform: translateY(-1px);
}

.theme-toggle__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.theme-toggle__icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.theme-toggle__icon--dark {
    display: none;
}

.theme-toggle[data-theme-mode="light"] .theme-toggle__icon--light {
    display: none;
}

.theme-toggle[data-theme-mode="light"] .theme-toggle__icon--dark {
    display: inline-flex;
}

.login-backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: 0.12;
    mask-image: linear-gradient(180deg, black, rgba(0, 0, 0, 0.2));
}

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 56px;
    align-items: center;
    width: min(1180px, calc(100vw - 48px));
    min-height: calc(100vh - 180px);
    margin: 0 auto;
    padding: 48px 0;
}

.login-hero {
    max-width: 720px;
}

.login-hero__eyebrow,
.login-card__kicker {
    display: inline-block;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-hero__title {
    max-width: 12ch;
    margin: 18px 0 18px;
    font-family: "Fraunces", serif;
    font-size: clamp(2rem, 3.2vw, 3.5rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
}

html[lang="hy"] .login-hero__title {
    max-width: 14ch;
    font-size: clamp(1.65rem, 2.6vw, 2.9rem);
    line-height: 1.08;
}

.login-hero__media {
    margin-top: 24px;
    height: 356px;
    border: 1px solid var(--panel-border);
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(6, 8, 12, 0.04), rgba(6, 8, 12, 0.36)),
        linear-gradient(135deg, rgba(8, 12, 18, 0.24), rgba(8, 12, 18, 0.08)),
        url("../assets/login/zvartnoc.jpg") center 38% / cover no-repeat;
    box-shadow: var(--shadow);
}

.login-card {
    padding: 28px;
    border: 1px solid var(--panel-border);
    border-radius: 26px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-card__logo-link {
    position: absolute;
    top: 12px;
    right: 24px;
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
}

.login-card__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-card__title {
    margin: 0 96px 12px 0;
    font-size: clamp(1.55rem, 1.8vw, 1.95rem);
    line-height: 1.1;
}

.login-card__copy,
.login-card__footnote {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.login-field {
    display: block;
    position: relative;
}

.login-field--password .login-field__input {
    padding-right: 58px;
}

.login-field__input {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.login-field__input::placeholder {
    color: rgba(215, 220, 229, 0.46);
}

.login-field__input:focus {
    border-color: rgba(214, 161, 69, 0.44);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(214, 161, 69, 0.12);
    outline: none;
}

.login-field__toggle {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: rgba(215, 220, 229, 0.66);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 140ms ease, color 140ms ease;
}

.login-field__toggle:hover,
.login-field__toggle:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(244, 247, 252, 0.94);
    outline: none;
}

.login-field__toggle-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-field__toggle-icon svg {
    width: 18px;
    height: 18px;
}

.login-field__toggle-icon--hide {
    display: none;
}

.login-field__toggle[aria-pressed="true"] .login-field__toggle-icon--show {
    display: none;
}

.login-field__toggle[aria-pressed="true"] .login-field__toggle-icon--hide {
    display: inline-flex;
}

.login-form__submit {
    min-height: 56px;
    margin-top: 6px;
    border: 1px solid rgba(214, 161, 69, 0.22);
    border-radius: 17px;
    background: linear-gradient(180deg, #d8aa56, #cb9436);
    color: #17110a;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.login-form__submit:hover,
.login-form__submit:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(214, 161, 69, 0.18);
    outline: none;
}

.login-form__error {
    margin: 10px 0 0;
    color: #ffb6b2;
    font-size: 0.92rem;
    line-height: 1.5;
}

.login-form__error.is-hidden {
    display: none;
}

.login-contact {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100vw - 48px));
    margin: 0 auto 28px;
    padding: 22px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.login-contact__content {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: flex-start;
}

.login-contact__details {
    display: grid;
    gap: 12px;
}

.login-contact__title {
    margin: 0 0 4px;
    color: #ff8e18;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.3;
}

.login-contact__item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #eef2f8;
    font-size: 0.98rem;
    line-height: 1.5;
}

.login-contact__icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    color: #f3f6fb;
    flex-shrink: 0;
}

.login-contact__icon svg,
.login-social svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.login-contact__social {
    display: flex;
    gap: 18px;
    align-items: center;
    padding-top: 6px;
}

.login-social {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #232323;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    transition: transform 140ms ease, opacity 140ms ease;
}

.login-social:hover,
.login-social:focus-visible {
    transform: translateY(-1px);
    opacity: 0.92;
    outline: none;
}

.login-social svg {
    width: 20px;
    height: 20px;
}

.login-contact__status {
    margin: 10px 0 0;
    color: rgba(243, 245, 248, 0.76);
    font-size: 13px;
    line-height: 1.4;
}

.login-contact__status.is-hidden {
    display: none;
}

.locale-menu {
    position: relative;
    z-index: 3;
}

.locale-menu--floating {
    position: relative;
    top: auto;
    right: auto;
}

.locale-menu__trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(8, 12, 18, 0.94);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
    color: var(--text);
    cursor: pointer;
    transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.locale-menu__trigger:hover,
.locale-menu__trigger:focus-visible,
.locale-menu.is-open .locale-menu__trigger {
    border-color: rgba(184, 138, 71, 0.4);
    background: rgba(14, 18, 26, 0.98);
    outline: none;
}

.locale-menu__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
}

.locale-menu__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.locale-menu__caret {
    position: absolute;
    right: 11px;
    bottom: 11px;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.74;
}

.locale-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 80px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(10, 13, 19, 0.96);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(16px);
}

.locale-menu.is-open .locale-menu__dropdown {
    display: grid;
    gap: 4px;
}

.locale-menu__dropdown[hidden] {
    display: none !important;
}

.locale-menu__option {
    min-height: 34px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(243, 245, 248, 0.78);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
    cursor: pointer;
}

.locale-menu__option:hover,
.locale-menu__option:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafd;
    outline: none;
}

.locale-menu__option.is-active {
    background: #f2f1f4;
    color: #1a1d24;
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 30px;
        width: min(760px, calc(100vw - 32px));
        min-height: auto;
        padding: 92px 0 24px;
    }

    .login-hero__title {
        max-width: none;
    }

    .login-hero__media {
        height: 300px;
    }

    .login-contact {
        width: min(760px, calc(100vw - 32px));
        margin-bottom: 22px;
    }

    .login-contact__content {
        flex-direction: column;
    }

    .login-contact__social {
        padding-top: 4px;
    }
}

@media (max-width: 720px) {
    .history-nav {
        top: 12px;
        left: 12px;
        border-radius: 16px;
    }

    .history-nav__button {
        width: 38px;
        height: 46px;
        font-size: 16px;
    }

    .login-top-actions {
        top: 12px;
        right: 12px;
        gap: 10px;
    }

    .locale-menu--floating {
        top: auto;
        right: auto;
    }

    .locale-menu__trigger {
        width: 58px;
        height: 46px;
        border-radius: 16px;
    }

    .theme-toggle {
        width: 58px;
        height: 46px;
        border-radius: 16px;
    }

    .login-shell {
        width: calc(100vw - 24px);
        padding: 84px 0 18px;
    }

    .login-card {
        padding: 22px 18px;
        border-radius: 22px;
    }

    .login-hero__media {
        height: 224px;
        border-radius: 22px;
    }

    .login-card__logo-link {
        width: 66px;
        height: 66px;
        top: 10px;
        right: 18px;
    }

    .login-contact {
        width: calc(100vw - 24px);
        padding-top: 18px;
        margin-bottom: 18px;
    }

    .login-contact__title {
        font-size: 1rem;
    }

    .login-contact__item {
        gap: 12px;
        font-size: 0.94rem;
    }

    .login-contact__social {
        gap: 14px;
    }

    .login-social {
        width: 44px;
        height: 44px;
    }

    .login-card__copy,
    .login-card__footnote {
        font-size: 0.94rem;
    }
}

:root[data-theme="light"] .history-nav,
:root[data-theme="light"] .theme-toggle,
:root[data-theme="light"] .locale-menu__trigger,
:root[data-theme="light"] .login-card,
:root[data-theme="light"] .login-social {
    border-color: rgba(68, 84, 111, 0.14);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 28px rgba(75, 94, 126, 0.12);
    color: var(--text);
}

:root[data-theme="light"] .history-nav__button,
:root[data-theme="light"] .login-contact__item,
:root[data-theme="light"] .login-contact__icon,
:root[data-theme="light"] .login-contact__status,
:root[data-theme="light"] .locale-menu__trigger,
:root[data-theme="light"] .theme-toggle {
    color: var(--text);
}

:root[data-theme="light"] .history-nav__button:hover,
:root[data-theme="light"] .history-nav__button:focus-visible,
:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .theme-toggle:focus-visible,
:root[data-theme="light"] .locale-menu__trigger:hover,
:root[data-theme="light"] .locale-menu__trigger:focus-visible {
    background: rgba(245, 248, 252, 0.98);
}

:root[data-theme="light"] .locale-menu__option,
:root[data-theme="light"] .login-social,
:root[data-theme="light"] .login-contact__status {
    color: var(--text);
}

:root[data-theme="light"] .login-backdrop {
    opacity: 0.55;
}

:root[data-theme="light"] .login-contact {
    border-top-color: rgba(68, 84, 111, 0.12);
}

:root[data-theme="light"] .locale-menu__dropdown {
    border-color: rgba(68, 84, 111, 0.14);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
}

:root[data-theme="light"] .login-field__input {
    border-color: rgba(68, 84, 111, 0.14);
    background: rgba(247, 249, 252, 0.96);
    color: var(--text);
}

:root[data-theme="light"] .login-field__toggle {
    color: rgba(59, 74, 100, 0.64);
}

:root[data-theme="light"] .login-field__toggle:hover,
:root[data-theme="light"] .login-field__toggle:focus-visible {
    background: rgba(68, 84, 111, 0.08);
    color: rgba(22, 36, 56, 0.92);
}

:root[data-theme="light"] .login-contact__title {
    color: #b46f17;
}
