/* ==========================================================================
   VLP (E-LOGISTICS) Keycloak login theme
   Ported from apps/web/vlp-logistics .../sign-in/sign-in.component.scss
   so the Keycloak login page matches the app /sign-in screen 1:1.
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

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

body.vlp-auth-body {
    font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.auth-page {
    --auth-primary: #0f766e;
    --auth-primary-dark: #115e59;
    --auth-accent: #14b8a6;
    --auth-accent-dark: #0f766e;
    --auth-ink: #10213d;
    --auth-muted: #62708a;
    position: relative;
    display: grid;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background: #f4f7fb;
    color: var(--auth-ink);
}

.auth-page--sign-in {
    grid-template-columns: minmax(420px, 1.08fr) minmax(520px, 0.92fr);
}

/* ===== LEFT hero ===== */
.auth-story {
    position: relative;
    display: flex;
    height: 100%;
    min-height: 0;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    padding: clamp(48px, 6vw, 92px);
    background: #0b1f33 url("../img/login-bg.jpg") center/cover no-repeat;
    color: #fff;
}

.auth-story__overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 78% 18%, rgba(20, 184, 166, 0.3), transparent 34%),
        linear-gradient(145deg, rgba(7, 31, 47, 0.72), rgba(11, 31, 51, 0.96) 72%);
}

.auth-story::after {
    position: absolute;
    right: -160px;
    bottom: -210px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    box-shadow:
        0 0 0 54px rgba(255, 255, 255, 0.035),
        0 0 0 108px rgba(255, 255, 255, 0.025);
    content: "";
}

.auth-story__content,
.auth-story__metric {
    position: relative;
    z-index: 1;
    max-width: 650px;
}

.auth-story__eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
}

.auth-story__pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #54d8a8;
    box-shadow: 0 0 0 5px rgba(84, 216, 168, 0.15);
}

.auth-story h1 {
    max-width: 620px;
    margin: 0;
    font-size: clamp(38px, 4.4vw, 66px);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.04;
}

.auth-story__content > p {
    max-width: 570px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: clamp(16px, 1.25vw, 19px);
    line-height: 1.65;
}

.auth-story__features {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 30px;
}

.auth-story__features span {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.auth-story__metric {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 56px;
    padding-top: 23px;
    border-top: 1px solid rgba(255, 255, 255, 0.17);
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.auth-story__metric strong {
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0;
    text-transform: none;
}

/* ===== RIGHT panel ===== */
.auth-panel {
    position: relative;
    display: flex;
    height: 100%;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 60px clamp(32px, 5vw, 80px) 28px;
    background:
        radial-gradient(circle at 100% 0, rgba(20, 184, 166, 0.09), transparent 30%),
        #fff;
}

/* ===== language switcher ===== */
.auth-language-picker {
    position: absolute;
    z-index: 5;
    top: 24px;
    right: clamp(24px, 4vw, 56px);
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--auth-muted);
}

.auth-language-picker__label {
    font-size: 12px;
    font-weight: 650;
}

.vlp-lang { position: relative; }

.vlp-lang__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #dce3ed;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(22, 47, 84, 0.06);
    color: var(--auth-ink);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.vlp-lang__trigger svg { width: 16px; height: 16px; opacity: 0.6; }

.vlp-lang__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid #e2e8f2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(16, 33, 61, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.vlp-lang.is-open .vlp-lang__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vlp-lang__menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 7px;
    color: #344258;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.vlp-lang__menu a:hover { background: #f1f6fb; color: var(--auth-accent-dark); }

/* ===== auth card ===== */
.auth-card { width: min(100%, 470px); }

.auth-card__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.auth-brand-logo {
    display: block;
    width: auto;
    max-width: min(230px, 70%);
    height: auto;
    max-height: 66px;
    object-fit: contain;
    object-position: left center;
}

.auth-card__heading { margin-top: 32px; }

.auth-card__kicker {
    display: block;
    margin-bottom: 8px;
    color: var(--auth-accent-dark);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-card__heading h2 {
    margin: 0;
    color: var(--auth-ink);
    font-size: clamp(30px, 3vw, 38px);
    font-weight: 750;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.auth-card__heading p {
    margin: 10px 0 0;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* ===== alerts ===== */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 24px;
    padding: 12px 14px;
    border: 1px solid #cbdcf3;
    border-radius: 11px;
    background: #f0f6ff;
    color: #24558e;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.5;
}

.auth-alert svg { width: 18px; min-width: 18px; margin-top: 1px; }

.auth-alert--error {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b4233c;
}

.auth-alert--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #157347;
}

.auth-alert--warning,
.auth-alert--info {
    border-color: #cbdcf3;
    background: #f0f6ff;
    color: #24558e;
}

.vlp-required-hint {
    margin-top: 16px;
    color: var(--auth-muted);
    font-size: 12px;
}

.vlp-required-mark { color: #dc5268; }

/* ===== form ===== */
.vlp-form-wrapper { margin-top: 24px; }

.vlp-login-form { width: 100%; font-size: 14px; }

.vlp-field { margin-bottom: 17px; }

.vlp-label {
    display: block;
    margin-bottom: 7px;
    color: #344258;
    font-size: 13px;
    font-weight: 650;
}

.vlp-input-wrap { position: relative; }

.vlp-input {
    width: 100%;
    height: 48px;
    padding: 0 13px;
    border: 1px solid #cfd8e6;
    border-radius: 10px;
    background: #fff;
    color: var(--auth-ink);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vlp-input::placeholder { color: #9aa7bb; }

.vlp-input:focus,
.vlp-input:active {
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.14);
}

.vlp-input[aria-invalid="true"] { border-color: #dc5268; }

.vlp-input-wrap .vlp-input { padding-right: 46px; }

.vlp-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8290a4;
    cursor: pointer;
}

.vlp-password-toggle:hover { color: var(--auth-accent-dark); }
.vlp-password-toggle svg { width: 18px; height: 18px; }
.vlp-password-toggle .vlp-eye-off { display: none; }
.vlp-password-toggle.is-visible .vlp-eye { display: none; }
.vlp-password-toggle.is-visible .vlp-eye-off { display: inline-block; }

.vlp-field-error {
    margin: -8px 0 12px;
    color: #c63850;
    font-size: 12px;
    line-height: 1.5;
}

.auth-form-options {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: -4px;
    margin-bottom: 4px;
}

.auth-form-options a,
.vlp-link {
    color: var(--auth-accent-dark);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}

.auth-form-options a:hover,
.vlp-link:hover { color: var(--auth-accent); text-decoration: underline; }

.vlp-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4e5e74;
    font-size: 13px;
    cursor: pointer;
}

.vlp-checkbox input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-accent);
    cursor: pointer;
}

/* ===== submit button ===== */
.auth-submit {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent-dark));
    box-shadow: 0 10px 24px rgba(18, 100, 216, 0.22);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.auth-submit svg { width: 18px; height: 18px; }

.auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 13px 28px rgba(18, 100, 216, 0.28);
}

.auth-submit:disabled { box-shadow: none; cursor: not-allowed; opacity: 0.72; }

/* spinner shows only while submitting */
.vlp-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.75s linear infinite;
}

.auth-submit.is-loading .vlp-spinner { display: inline-block; }
.auth-submit.is-loading .vlp-btn-arrow { display: none; }

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

/* ===== register / social ===== */
.vlp-register,
.vlp-info {
    margin-top: 18px;
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

.vlp-social { margin-top: 22px; }

.vlp-social__divider {
    position: relative;
    margin-bottom: 16px;
    text-align: center;
}

.vlp-social__divider::before {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #e7ecf3;
    content: "";
}

.vlp-social__divider span {
    position: relative;
    padding: 0 12px;
    background: #fff;
    color: #8290a4;
    font-size: 12px;
}

.vlp-social__list { display: flex; flex-direction: column; gap: 10px; }

.vlp-social__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    border: 1px solid #cfd8e6;
    border-radius: 10px;
    background: #fff;
    color: #344258;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.vlp-social__btn:hover { border-color: var(--auth-accent); color: var(--auth-accent-dark); }

/* ===== footer ===== */
.auth-card__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #e7ecf3;
    color: #8290a4;
    font-size: 11px;
    text-align: center;
}

.auth-card__footer svg { width: 14px; min-width: 14px; }

input::-ms-reveal,
input::-ms-clear { display: none; }

/* ==========================================================================
   Responsive — mirrors the app breakpoints
   ========================================================================== */
@media (max-width: 1100px) {
    .auth-page--sign-in { grid-template-columns: 0.88fr 1.12fr; }
    .auth-story { padding: 52px 44px; }
    .auth-story h1 { font-size: 42px; }
}

@media (max-width: 900px) {
    .auth-page--sign-in { display: block; }
    .auth-story { display: none; }
    .auth-panel {
        padding: 94px 28px 44px;
        background:
            radial-gradient(circle at 100% 0, rgba(20, 184, 166, 0.12), transparent 38%),
            linear-gradient(180deg, #f7faff, #fff 42%);
    }
}

@media (max-width: 520px) {
    .auth-panel { align-items: flex-start; padding: 78px 22px 32px; }
    .auth-language-picker { top: 16px; right: 16px; }
    .auth-language-picker__label { display: none; }
    .auth-brand-logo { max-width: 190px; max-height: 56px; }
    .auth-card__heading { margin-top: 34px; }
    .auth-card__heading h2 { font-size: 30px; }
    .auth-form-options { align-items: flex-start; }
}

@media (max-height: 740px) {
    .auth-story { justify-content: center; padding-top: 30px; padding-bottom: 30px; }
    .auth-story__eyebrow { margin-bottom: 14px; padding: 6px 11px; }
    .auth-story h1 { font-size: clamp(32px, 3.5vw, 48px); }
    .auth-story__content > p { margin-top: 14px; font-size: 15px; line-height: 1.45; }
    .auth-story__features { margin-top: 18px; }
    .auth-story__features span { padding: 7px 11px; }
    .auth-story__metric { margin-top: 24px; padding-top: 14px; }
    .auth-panel { padding-top: 50px; padding-bottom: 16px; }
    .auth-language-picker { top: 12px; }
    .auth-brand-logo { max-height: 52px; }
    .auth-card__heading { margin-top: 18px; }
    .auth-card__kicker { margin-bottom: 5px; }
    .auth-card__heading h2 { font-size: 30px; }
    .auth-card__heading p { margin-top: 6px; line-height: 1.45; }
    .vlp-form-wrapper { margin-top: 16px; }
    .vlp-field { margin-bottom: 10px; }
    .vlp-input { height: 44px; }
    .auth-form-options { min-height: 36px; }
    .auth-submit { min-height: 44px; margin-top: 3px; }
    .auth-card__footer { margin-top: 12px; padding-top: 10px; }
}

@media (max-width: 520px) and (max-height: 740px) {
    .auth-panel { padding: 58px 18px 16px; }
    .auth-card__heading { margin-top: 18px; }
    .auth-form-options { align-items: center; }
}
