:root {
    --wf-ink: #1a2744;
    --wf-muted: #6b7a94;
    --wf-green: #1e6b34;
    --wf-tagline: #2f7a45;
    --wf-line: #cfd8e6;
    --wf-card: #ffffff;
    --wf-grad: linear-gradient(90deg, #6b2cf5 0%, #9b2ad8 45%, #d80a9a 100%);
    --wf-focus: #7a3cf0;
}

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

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

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--wf-ink);
    background: #1a2a18 url("../../../assets/images/bg.jpg") left bottom / cover no-repeat fixed;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.step-hidden {
    display: none !important;
}

.wf-login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
}

.wf-layout {
    width: min(900px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(340px, 400px);
    gap: 28px;
    align-items: start;
}

.wf-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 4px 0 0;
}

.wf-logo {
    display: block;
    width: 200px;
    height: auto;
    margin: 0 auto;
    align-self: center;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.28));
}

.wf-logo-type {
    margin: 0;
    color: #fff;
    font-size: clamp(3.4rem, 7vw, 5.2rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 0.92;
    filter: drop-shadow(0 8px 18px rgb(0 0 0 / 0.45));
    text-shadow:
        0 2px 4px rgb(0 0 0 / 0.45),
        0 8px 18px rgb(0 0 0 / 0.35);
}

.wf-tagline {
    margin: 0;
    color: #fff;
    font-size: clamp(1.25rem, 2.4vw, 1.65rem);
    font-style: italic;
    font-weight: 600;
    letter-spacing: 0.01em;
    filter: drop-shadow(0 6px 14px rgb(0 0 0 / 0.4));
    text-shadow:
        0 1px 3px rgb(0 0 0 / 0.45),
        0 6px 14px rgb(0 0 0 / 0.3);
}

.wf-card-wrap {
    position: relative;
    width: 100%;
}

.wf-card-accent {
    position: absolute;
    z-index: 0;
    top: -5px;
    left: 0;
    right: 0;
    height: 45px;
    background: linear-gradient(90deg, #9b2ad8 0%, #5a36d6 55%, #3f51b5 100%);
    border-radius: 25px;
}

.wf-card {
    position: relative;
    z-index: 1;
    width: 100%;
    background: var(--wf-card);
    border-radius: 22px;
    box-shadow: 0 16px 40px rgb(16 28 48 / 0.28);
    padding: 36px 34px 40px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}

.wf-card-head {
    margin-bottom: 20px;
    position: relative;
    text-align: center;
}

.wf-welcome {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #15233d;
    line-height: 1.15;
}

.wf-welcome-sub {
    margin: 8px 0 0;
    color: var(--wf-muted);
    font-size: 0.98rem;
}

.wf-otp-actions {
    position: absolute;
    top: 0;
    right: 0;
}

.wf-back-btn {
    border: 0;
    background: transparent;
    color: #5a36d6;
    font-weight: 700;
    padding: 4px 0;
}

.wf-error {
    display: none;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fdebec;
    color: #a11d28;
    font-size: 0.92rem;
    line-height: 1.35;
}

.wf-error.is-visible {
    display: block;
}

.wf-error.is-success {
    background: #e8f7ec;
    color: #1f6b2e;
}

.wf-form {
    width: 100%;
    display: grid;
    gap: 16px;
}

.wf-login-section,
.wf-otp-section {
    margin: 0;
    padding: 0;
    border: 0;
    min-inline-size: 0;
    display: grid;
    gap: 16px;
}

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

.wf-field-ico {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #8a96ab;
    pointer-events: none;
}

.wf-field input {
    width: 100%;
    min-height: 52px;
    border: 1.5px solid var(--wf-line);
    border-radius: 999px;
    padding: 0 48px 0 48px;
    background: #fff;
    color: var(--wf-ink);
}

.wf-field input::placeholder {
    color: #9aa6bb;
}

.wf-field input:focus {
    outline: none;
    border-color: var(--wf-focus);
    box-shadow: 0 0 0 3px rgb(122 60 240 / 0.16);
}

.wf-toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #8a96ab;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
}

.wf-toggle-password:hover {
    color: #4d5d78;
    background: rgb(122 60 240 / 0.08);
}

.wf-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 4px;
}

.wf-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--wf-muted);
    font-size: 0.95rem;
    user-select: none;
}

.wf-shortcut input {
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
}

.wf-submit {
    min-height: 54px;
    border: 0;
    border-radius: 999px;
    background: var(--wf-grad);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 22px rgb(122 30 180 / 0.32);
}

.wf-submit:hover {
    filter: brightness(1.04);
}

.wf-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgb(255 255 255 / 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wf-spin 0.7s linear infinite;
}

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

.wf-otp-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--wf-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.otp-digit {
    min-height: 52px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    border: 1.5px solid var(--wf-line);
    border-radius: 12px;
}

.otp-digit:focus {
    outline: none;
    border-color: var(--wf-focus);
    box-shadow: 0 0 0 3px rgb(122 60 240 / 0.16);
}

.otp-resend-row {
    display: flex;
    justify-content: flex-end;
}

.otp-resend-link {
    border: 0;
    background: transparent;
    color: #5a36d6;
    font-weight: 700;
    padding: 0;
}

.otp-resend-link:disabled {
    color: #98a2b3;
    cursor: default;
}

@media (max-width: 900px) {
    .wf-login-page {
        padding: 28px 18px 40px;
    }

    .wf-layout {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 22px;
        width: min(400px, 100%);
    }

    .wf-brand {
        align-items: center;
        text-align: center;
    }

    .wf-logo {
        width: 200px;
        max-width: 100%;
    }

    .wf-logo-type {
        font-size: clamp(2.8rem, 12vw, 3.8rem);
    }

    .wf-card-wrap {
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .wf-card {
        padding: 26px 18px 22px;
        border-radius: 16px;
    }

    .wf-welcome {
        font-size: 1.7rem;
    }

    .otp-inputs {
        gap: 6px;
    }
}
