/* =========================================================
   Lin2Web — auth pages (login, register, password, verify)
   Loaded after auth.css + theme.css on layouts/auth.
   ========================================================= */

.auth-page {
    min-height: 100%;
    background: var(--ink);
    color: var(--text);
}
.auth-page main { height: auto; min-height: 100%; }
.auth-page a { color: inherit; text-decoration: none; }

/* ---------- Background ---------- */
.auth-page .main-bg { background-position: 30% 30%; }
.auth-page .main-bg::before {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: radial-gradient(60% 70% at 50% 55%, rgba(14, 11, 9, .55), transparent 70%);
}
.auth-page .main-bg::after { z-index: 0; }

/* ---------- Top bar ---------- */
.auth_wrapper {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.auth_top {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 32px;
    padding: 12px 40px;
    background: linear-gradient(180deg, rgba(14, 11, 9, .92), rgba(14, 11, 9, .72));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--panel-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.auth_top::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: .6;
}
.auth-brand { display: flex; align-items: center; flex: none; }
.auth-brand img { height: 40px; width: auto; display: block; transition: filter .2s; }
.auth-brand:hover img { filter: brightness(1.15) drop-shadow(0 0 10px rgba(230, 194, 122, .35)); }

.auth_nav_top { padding: 0; margin-right: auto; }
.auth_nav_top ul { display: flex; gap: 4px; }
.auth_nav_top a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: #d8ccb6;
    font-family: var(--font-accent-bold), serif;
    font-size: 14px;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: color .2s;
}
.auth_nav_top a::after {
    content: "";
    position: absolute; left: 16px; right: 16px; bottom: 4px; height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform .25s var(--ease);
}
.auth_nav_top a:hover, .auth_nav_top a:focus-visible { color: var(--gold); }
.auth_nav_top a:hover::after, .auth_nav_top a:focus-visible::after { transform: scaleX(1); }
.auth_nav_top svg { width: 18px; height: 18px; opacity: .85; }

.auth_top_r { display: flex; align-items: center; gap: 14px; flex: none; }
.auth-download svg { width: 18px; height: 18px; }

/* Language switcher (UI_BtnSmall) */
.auth-page .nav__langs { z-index: 60; }
.auth-page .nav__langs-item {
    height: auto;
    min-height: 36px;
    padding: 4px 12px;
    gap: 8px;
    border-radius: 0;
    background: none;
    color: #f3e6c8;
    font-family: var(--font-accent-bold), serif;
    font-size: 12px;
    letter-spacing: .08em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, .8);
}
.auth-page .nav__langs-item--current {
    border: 3px solid transparent;
    border-image: url("../img/ui/UI_BtnSmall_Normal.png") 6 fill / 3px stretch;
    user-select: none;
}
.auth-page .nav__langs-item--current:hover { border-image-source: url("../img/ui/UI_BtnSmall_Hover.png"); color: #fff4d6; }
.auth-page .nav__langs-item--current.active { border-image-source: url("../img/ui/UI_BtnSmall_Pressed.png"); }
.auth-page .nav__langs-item img { width: 20px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.auth-page .nav__langs-stroke {
    top: calc(100% + 8px);
    min-width: 100%;
    padding: 6px;
    background: rgba(20, 16, 12, .97);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}
.auth-page .nav__langs-stroke li:not(:first-child) { margin-top: 2px; }
.auth-page .nav__langs-stroke .nav__langs-item {
    border-radius: 4px;
    color: #d8ccb6;
    transition: background .2s, color .2s;
}
.auth-page .nav__langs-stroke .nav__langs-item:hover { background: rgba(230, 194, 122, .1); color: var(--gold); }

/* ---------- Card ---------- */
.auth-content {
    flex: 1;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 56px 20px 32px;
}
.auth-page .content.auth-card {
    position: relative;
    width: min(500px, 100%);
    min-width: 0;
    max-width: none;
    padding: 52px 48px 40px;
    border-radius: 4px;
    background:
        radial-gradient(120% 60% at 50% 0%, rgba(230, 194, 122, .09), transparent 60%),
        linear-gradient(180deg, rgba(32, 25, 18, .94), rgba(14, 11, 9, .96));
    border: 1px solid var(--panel-border);
    box-shadow:
        inset 0 0 0 5px rgba(0, 0, 0, .35),
        inset 0 0 0 6px rgba(201, 164, 99, .14),
        0 30px 80px rgba(0, 0, 0, .65),
        0 0 120px rgba(230, 194, 122, .06);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: authRise .6s var(--ease) both;
}
.auth-page .content.auth-card::before {
    content: "";
    position: absolute; z-index: 0; inset: -1px 12% auto; height: 1px;
    padding: 0; border-radius: 0;
    -webkit-mask: none; mask: none;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.auth-page .content.auth-card::after {
    content: "";
    position: absolute; z-index: 0; inset: auto 20% -1px;
    height: 1px; padding: 0; border-radius: 0;
    background: linear-gradient(90deg, transparent, rgba(230, 194, 122, .55), transparent);
}
.auth-card > :not(.auth-card__corner):not(.auth-card__crest) { position: relative; z-index: 1; }

.auth-card__corner {
    position: absolute;
    width: 26px; height: 26px;
    border: 0 solid var(--gold);
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(230, 194, 122, .35));
}
.auth-card__corner::after {
    content: "";
    position: absolute;
    width: 5px; height: 5px;
    background: var(--gold);
    transform: rotate(45deg);
}
.auth-card__corner--tl { top: 8px; left: 8px; border-top-width: 2px; border-left-width: 2px; }
.auth-card__corner--tr { top: 8px; right: 8px; border-top-width: 2px; border-right-width: 2px; }
.auth-card__corner--bl { bottom: 8px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; }
.auth-card__corner--br { bottom: 8px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; }
.auth-card__corner--tl::after { top: 4px; left: 4px; }
.auth-card__corner--tr::after { top: 4px; right: 4px; }
.auth-card__corner--bl::after { bottom: 4px; left: 4px; }
.auth-card__corner--br::after { bottom: 4px; right: 4px; }

.auth-card__crest {
    position: absolute;
    top: -13px; left: 50%;
    width: 24px; height: 24px;
    margin-left: -12px;
    transform: rotate(45deg);
    background: linear-gradient(135deg, #2a2017, #0e0b09);
    border: 1px solid var(--gold);
    box-shadow: 0 0 0 4px rgba(14, 11, 9, .9), 0 0 18px rgba(230, 194, 122, .45);
    display: grid; place-items: center;
}
.auth-card__crest span {
    width: 8px; height: 8px;
    background: var(--gold);
    box-shadow: 0 0 10px var(--gold);
}

@keyframes authRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.auth-copy {
    margin: 0;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #7d7365;
}

/* ---------- Heading ---------- */
.auth-head { text-align: center; margin-bottom: 30px; }
.auth-eyebrow {
    font-family: var(--font-accent-regular), serif;
    font-size: 11px;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--gold-soft);
    margin-bottom: 10px;
}
.auth-page .title {
    margin: 0;
    font-family: var(--font-accent-bold), serif;
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--gold);
    background: linear-gradient(180deg, #fff4d6 0%, #e6c27a 55%, #a87f41 100%) 0 0 / 100% 1.15em repeat-y;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .6));
}
.auth-head .ornament { width: 220px; max-width: 70%; margin: 16px auto 0; }
.auth-lead {
    margin: 16px auto 0;
    max-width: 380px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-muted);
}

.auth-emblem {
    width: 76px; height: 76px;
    margin: 0 auto 20px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--gold);
    background: radial-gradient(circle, rgba(230, 194, 122, .16), rgba(230, 194, 122, 0) 70%);
    border: 1px solid var(--gold);
    box-shadow: 0 0 0 6px rgba(14, 11, 9, .8), 0 0 0 7px rgba(201, 164, 99, .35), 0 0 30px rgba(230, 194, 122, .25);
    animation: authGlow 2.8s ease-in-out infinite;
}
.auth-emblem svg { width: 34px; height: 34px; }
.auth-emblem--success { color: #a8dc8c; border-color: #a8dc8c; }
@keyframes authGlow {
    0%, 100% { box-shadow: 0 0 0 6px rgba(14, 11, 9, .8), 0 0 0 7px rgba(201, 164, 99, .35), 0 0 22px rgba(230, 194, 122, .18); }
    50%      { box-shadow: 0 0 0 6px rgba(14, 11, 9, .8), 0 0 0 7px rgba(201, 164, 99, .55), 0 0 40px rgba(230, 194, 122, .4); }
}

.verify-email {
    display: inline-block;
    margin: 16px auto 0;
    padding: 8px 18px;
    border: 1px solid var(--panel-border);
    border-radius: 3px;
    background: rgba(230, 194, 122, .07);
    color: var(--gold);
    font-family: var(--font-bold), sans-serif;
    font-size: 14px;
    word-break: break-all;
}

/* ---------- Form ---------- */
.auth-page .form-group { margin-bottom: 20px; }
.auth-page .form-group:last-child { margin-bottom: 0; }

.auth-label {
    display: block;
    margin-bottom: 8px;
    font-family: var(--font-accent-bold), serif;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #cbbd9f;
}

.auth-input { position: relative; display: flex; align-items: center; }
.auth-input__icon {
    position: absolute; left: 15px; z-index: 1;
    width: 18px; height: 18px;
    color: #8a7c66;
    pointer-events: none;
    transition: color .2s;
}
.auth-input:focus-within .auth-input__icon { color: var(--gold); }

.auth-page .form-control {
    height: 50px;
    padding: 0 16px 0 44px;
    border: 1px solid rgba(201, 164, 99, .22);
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(8, 6, 5, .85), rgba(18, 14, 10, .85));
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
    color: var(--text);
    font-size: 15px;
    transition: border-color .2s, box-shadow .25s, background .2s;
}
.auth-page .form-control::placeholder { color: #6f6555; opacity: 1; }
.auth-page .form-control:hover { border-color: rgba(201, 164, 99, .4); }
.auth-page .form-control:focus-visible { outline: none; }
.auth-page .form-control:focus {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(14, 11, 8, .92), rgba(24, 19, 13, .92));
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5), 0 0 0 3px rgba(230, 194, 122, .14), 0 0 22px rgba(230, 194, 122, .22);
}
.auth-page .password-group .form-control { padding-right: 52px; }
.auth-page .form-control:-webkit-autofill,
.auth-page .form-control:-webkit-autofill:hover,
.auth-page .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: inset 0 0 0 100px #15100c;
    caret-color: var(--text);
}

/* Password toggle -> UI_IconBtn */
.auth-page .password-toggle {
    right: 8px;
    z-index: 1;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 4px solid transparent;
    border-image: url("../img/ui/UI_IconBtn_Normal.png") 8 fill / 4px;
    color: #cbbd9f;
    transition: color .2s;
}
.auth-page .password-toggle:hover { border-image-source: url("../img/ui/UI_IconBtn_Hover.png"); color: #fff4d6; }
.auth-page .password-toggle:active { border-image-source: url("../img/ui/UI_IconBtn_Pressed.png"); }
.auth-page .password-toggle svg { width: 16px; height: 16px; }

/* Errors */
.auth-page .has-error .form-control {
    border-color: rgba(224, 102, 82, .75);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5), 0 0 0 3px rgba(224, 102, 82, .1);
}
.auth-page .text-danger {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0 0;
    color: #f09a88;
    font-size: 13px;
    line-height: 1.45;
}
.auth-page .text-danger::before {
    content: "";
    flex: none;
    width: 7px; height: 7px;
    margin-top: 5px;
    transform: rotate(45deg);
    background: #e07a66;
    box-shadow: 0 0 8px rgba(224, 122, 102, .6);
}

/* Checkbox */
.auth-page .checkbox-container {
    padding-left: 30px;
    font-size: 14px;
    color: var(--text-muted);
    transition: color .2s;
}
.auth-page .checkbox-container:hover { color: var(--text); }
.auth-page .checkmark {
    width: 20px; height: 20px;
    border: 1px solid var(--gold-soft);
    border-radius: 2px;
    background: rgba(8, 6, 5, .85);
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, .6);
}
.auth-page .checkbox-container input:checked ~ .checkmark {
    background: linear-gradient(180deg, #f0d596, #b98d4a);
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(230, 194, 122, .35);
}
.auth-page .checkbox-container input:checked ~ .checkmark::after {
    left: 6px; top: 2px;
    width: 5px; height: 10px;
    border-color: #1b130a;
}
.auth-page .checkbox-container input:focus-visible ~ .checkmark { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Rows / buttons */
.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.auth-page .login_button { margin-top: 28px; }
.auth-page .login_button button,
.auth-page .auth-actions .ui-btn--lg {
    width: 100%;
    height: auto;
    min-height: 56px;
    font-size: 16px;
    letter-spacing: .12em;
}
.auth-page .login_button svg { position: static; width: 20px; height: 20px; }

.auth-divider {
    position: relative;
    height: 1px;
    margin: 28px 0 22px;
    background: linear-gradient(90deg, transparent, var(--panel-border) 20%, var(--panel-border) 80%, transparent);
}
.auth-divider::after {
    content: "";
    position: absolute; left: 50%; top: 50%;
    width: 7px; height: 7px;
    margin: -4px 0 0 -4px;
    transform: rotate(45deg);
    background: var(--ink-2);
    border: 1px solid var(--gold-soft);
}
.auth-alt {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    text-align: center;
}
.auth-alt p { margin: 0; font-size: 14px; color: var(--text-muted); }

.auth-captcha { display: flex; flex-direction: column; align-items: center; }

.auth-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.auth-actions form, .auth-actions > .ui-btn--block { width: 100%; }
.auth-actions form.logout { width: auto; }
.auth-actions .ui-btn svg { width: 18px; height: 18px; }

/* ---------- Alerts ---------- */
.auth-page .alert-success,
.auth-page .alert-danger {
    gap: 12px;
    margin: 0 0 24px;
    padding: 14px 14px 14px 16px;
    border-radius: 3px;
    border: 1px solid rgba(150, 200, 120, .35);
    border-left: 3px solid #93c776;
    background: linear-gradient(90deg, rgba(70, 110, 48, .32), rgba(20, 16, 12, .6));
}
.auth-page .alert-danger {
    border-color: rgba(224, 102, 82, .4);
    border-left-color: #e07a66;
    background: linear-gradient(90deg, rgba(130, 40, 28, .35), rgba(20, 16, 12, .6));
}
.auth-page .alert-success p,
.auth-page .alert-danger p {
    padding-left: 34px;
    font-size: 14px;
    line-height: 1.5;
    color: #d8eec8;
}
.auth-page .alert-danger p { color: #f6c9bf; }
.auth-page .alert-success p::before,
.auth-page .alert-danger p::before {
    top: 50%; bottom: auto;
    width: 22px; height: 22px;
    transform: translateY(-50%);
}
.auth-page .close {
    flex: none;
    width: 20px; height: 20px;
    border-radius: 0;
    background: url("../img/ui/UI_Close_Normal.png") center / 20px 20px no-repeat;
}
.auth-page .close::before { content: none; }
.auth-page .close:hover { background-image: url("../img/ui/UI_Close_Hover.png"); }
.auth-page .close:active { background-image: url("../img/ui/UI_Close_Pressed.png"); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .auth_top { gap: 16px; padding: 10px 20px; }
}
@media (max-width: 675px) {
    .auth_wrapper { margin: 0; }
    .auth_top { gap: 6px; padding: 8px 12px; }
    .auth-brand img { height: 30px; }
    .auth_nav_top ul { gap: 0; }
    .auth_nav_top a { padding: 8px; font-size: 0; gap: 0; }
    .auth_nav_top a::after { left: 8px; right: 8px; }
    .auth_nav_top svg { width: 20px; height: 20px; }
    .auth_top_r { gap: 8px; }
    .auth-download { padding: 4px 10px; }
    .auth-download span { display: none; }
    .auth-page .nav__langs-item span { display: none; }
    .auth-page .nav__langs-stroke .nav__langs-item span { display: inline; }

    .auth-content { justify-content: flex-start; padding: 40px 14px 24px; }
    .auth-page .content.auth-card { padding: 44px 22px 30px; }
    .auth-page .title { font-size: 24px; }
    .auth-row { justify-content: space-between; }
    .auth-alt { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page .content.auth-card, .auth-emblem { animation: none; }
}
