:root {
    --auth-bg: #f3f4f6;
    --auth-panel: transparent;
    --auth-card: rgba(255, 255, 255, 0.16);
    --auth-text: #f8fafc;
    --auth-muted: #d1d5db;
    --auth-line: #e5e7eb;
    --auth-input: rgba(255, 255, 255, 0.64);
    --auth-input-text: #111827;
    --auth-primary: #111827;
    --auth-primary-hover: #000000;
    --auth-button-text: #ffffff;
    --auth-danger: #b42318;
    --auth-success: #067647;
    --auth-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

html.dark {
    --auth-bg: #090b0f;
    --auth-panel: transparent;
    --auth-card: rgba(10, 13, 18, 0.2);
    --auth-text: #f3f4f6;
    --auth-muted: #9ca3af;
    --auth-line: #2a3039;
    --auth-input: rgba(20, 25, 33, 0.62);
    --auth-input-text: #f3f4f6;
    --auth-primary: #f3f4f6;
    --auth-primary-hover: #ffffff;
    --auth-button-text: #111827;
    --auth-danger: #f97066;
    --auth-success: #47cd89;
    --auth-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

html,
body.login {
    min-height: 100%;
}

html.dark body.login,
html.dark body.login.login {
    background: #101216 !important;
}

body.login {
    position: relative;
    margin: 0;
    background: #101216 !important;
    color: var(--auth-text);
    overflow-x: hidden;
}

body.login::before {
    content: "";
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 46%, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.48) 78%),
        linear-gradient(180deg, rgba(5, 7, 10, 0.22), rgba(5, 7, 10, 0.5)),
        url('../../images/auth/dyno-auth-hero.png') center center / cover no-repeat;
}

.auth-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 88px 24px 48px;
}

.auth-visual {
    display: none;
}

.auth-panel {
    position: static;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
}

.auth-panel__inner {
    width: 100%;
    max-width: 560px;
}

.auth-panel__inner:has(.auth-card--wide) {
    max-width: 760px;
}

.auth-card {
    width: 100%;
    padding: clamp(26px, 4vw, 44px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 22px;
    background: var(--auth-card);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(3px) saturate(102%);
    -webkit-backdrop-filter: blur(3px) saturate(102%);
}

html.dark .auth-card {
    border-color: rgba(255, 255, 255, 0.11);
}

.auth-card--wide {
    padding: clamp(24px, 3.5vw, 42px);
}

.auth-brand {
    display: none;
}

.auth-brand img {
    display: block;
    width: min(220px, 68%);
    max-height: 64px;
    object-fit: contain;
    object-position: center;
}

html.dark .auth-brand img {
    filter: brightness(0) invert(1);
}

.auth-background-logo {
    position: fixed;
    z-index: 3;
    top: clamp(18px, 3.5vw, 46px);
    left: clamp(20px, 4vw, 62px);
    width: clamp(210px, 24vw, 360px);
    pointer-events: none;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.5));
}

.auth-background-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.auth-title {
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(1.7rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.auth-subtitle {
    margin: 10px 0 0;
    color: var(--auth-muted);
    font-size: 0.95rem;
    line-height: 1.65;
}

.auth-form {
    margin-top: 30px;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.auth-grid__full {
    grid-column: 1 / -1;
}

.auth-field {
    min-width: 0;
}

.auth-label {
    display: block;
    margin: 0 0 7px;
    color: var(--auth-text);
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-card .login__input,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card input[type="tel"],
.auth-card select,
.auth-card textarea {
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 0 15px;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    outline: none;
    color: var(--auth-input-text);
    background: var(--auth-input);
    box-shadow: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-card textarea {
    min-height: 110px;
    padding-top: 13px;
}

.auth-card .login__input:focus,
.auth-card input:focus,
.auth-card select:focus,
.auth-card textarea:focus {
    border-color: #6b7280;
    box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.12);
}

.auth-card input::placeholder,
.auth-card textarea::placeholder {
    color: #9ca3af;
}

.auth-error,
.login__input-error,
.help-block {
    display: block;
    width: 100%;
    margin-top: 6px;
    color: var(--auth-danger) !important;
    font-size: 0.78rem;
    line-height: 1.4;
}

.auth-success {
    margin-top: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(6, 118, 71, 0.22);
    border-radius: 10px;
    color: var(--auth-success);
    background: rgba(6, 118, 71, 0.07);
    font-size: 0.85rem;
}

.auth-options,
.auth-actions,
.auth-footer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-options {
    justify-content: space-between;
    margin-top: 18px;
    color: var(--auth-muted);
    font-size: 0.86rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.auth-check input {
    width: 16px !important;
    min-height: 16px !important;
    margin: 0;
}

.auth-link {
    color: var(--auth-text);
    font-weight: 650;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

button.auth-link {
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.auth-actions {
    margin-top: 24px;
}

.auth-button {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    padding: 0 20px;
    border: 1px solid var(--auth-primary);
    border-radius: 12px;
    color: var(--auth-button-text);
    background: var(--auth-primary);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.auth-button:hover {
    transform: translateY(-1px);
    color: var(--auth-button-text);
    background: var(--auth-primary-hover);
}

.auth-button--secondary {
    border-color: var(--auth-line);
    color: var(--auth-text);
    background: transparent;
}

.auth-button--secondary:hover {
    color: var(--auth-text);
    background: var(--auth-bg);
}

.auth-button--danger {
    border-color: #b42318;
    color: #ffffff;
    background: #b42318;
}

.auth-footer {
    justify-content: center;
    margin-top: 24px;
    color: var(--auth-muted);
    font-size: 0.88rem;
    text-align: center;
}

.auth-divider {
    height: 1px;
    margin: 26px 0;
    background: var(--auth-line);
}

.auth-code {
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border: 1px dashed var(--auth-line);
    border-radius: 12px;
    color: var(--auth-text);
    background: var(--auth-bg);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92rem;
    text-align: center;
    word-break: break-all;
    user-select: all;
}

.auth-qr {
    display: grid;
    place-items: center;
    margin: 24px 0;
    padding: 20px;
    border: 1px solid var(--auth-line);
    border-radius: 16px;
    background: #ffffff;
}

.auth-qr svg,
.auth-qr img {
    width: min(220px, 100%);
    height: auto;
}

.password-strength-bar {
    margin-top: 12px;
    color: var(--auth-muted);
    font-size: 0.78rem;
}

.password-strength-bar::after {
    content: "";
    display: block;
    height: 4px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--auth-line);
}

.password-strength-bar .bar {
    position: relative;
    z-index: 1;
    height: 4px;
    margin-bottom: -4px;
    border-radius: 999px;
    transition: width 180ms ease, background 180ms ease;
}

.auth-topbar {
    position: fixed;
    z-index: 60;
    top: 20px;
    right: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-language .dropdown-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--auth-line);
    border-radius: 12px;
    background: var(--auth-card);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.1);
    cursor: pointer;
}

.auth-language .dropdown-box {
    right: 0;
    left: auto;
}

.iti {
    width: 100%;
}

.g-recaptcha {
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 1023px) {
    .auth-layout {
        padding: 78px 20px 36px;
    }

    .auth-panel {
        padding: 0;
    }

    .auth-topbar {
        top: 14px;
        right: 14px;
    }
}

@media (max-width: 639px) {
    body.login::before {
        background-position: center, center, 58% center;
    }

    .auth-background-logo {
        top: 12px;
        left: 14px;
        width: 165px;
    }

    .auth-layout {
        align-items: flex-start;
        padding: 104px 12px 24px;
    }

    .auth-card,
    .auth-card--wide {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .auth-brand {
        margin-bottom: 24px;
    }

    .auth-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .auth-grid__full {
        grid-column: auto;
    }

    .auth-options,
    .auth-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-options {
        gap: 14px;
    }

    .auth-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-button,
    .auth-card input,
    .auth-card select,
    .auth-card textarea {
        transition: none;
    }
}
