* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #68748a;
    --border: #dce3ed;
    --primary: #1769e0;
    --primary-dark: #0f57c7;
    --error: #c93232;
    --error-bg: #fff3f3;
}

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

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(31, 105, 224, .07),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(31, 105, 224, .05),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* HEADER */

.topbar {
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 42px;

    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid #e5eaf1;

    backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 36px;
    height: 36px;

    border-radius: 8px;

    background: linear-gradient(
        135deg,
        #1769e0,
        #3d8cff
    );

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 3px;
}

.brand-mark span {
    display: block;

    width: 4px;
    height: 17px;

    border-radius: 3px;

    background: white;
}

.brand-mark span:nth-child(1) {
    height: 11px;
}

.brand-mark span:nth-child(2) {
    height: 20px;
}

.brand-mark span:nth-child(3) {
    height: 15px;
}

.brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-name strong {
    font-size: 17px;
    letter-spacing: .3px;
}

.brand-name span {
    margin-top: 4px;

    font-size: 8px;
    font-weight: 700;

    letter-spacing: 1.6px;

    color: #718096;
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 8px;

    color: #68748a;

    font-size: 12px;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #28a866;

    box-shadow: 0 0 0 3px rgba(40, 168, 102, .10);
}


/* MAIN */

.main {
    flex: 1;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 70px 20px;
}


/* CARD */

.login-card {
    width: 430px;

    padding: 38px 42px 28px;

    background: var(--card);

    border: 1px solid #e2e8f0;

    border-radius: 12px;

    box-shadow:
        0 18px 50px rgba(24, 43, 72, .08),
        0 2px 8px rgba(24, 43, 72, .03);
}

.card-header {
    text-align: center;

    margin-bottom: 32px;
}

.archive-icon {
    width: 58px;
    height: 58px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    color: var(--primary);

    background: #edf4ff;
}

.archive-icon svg {
    width: 31px;
    height: 31px;
}

.card-header h1 {
    margin: 0;

    font-size: 25px;
    font-weight: 650;

    letter-spacing: -.4px;
}

.card-header p {
    margin: 9px 0 0;

    color: var(--muted);

    font-size: 13px;
}


/* FORM */

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;

    margin-bottom: 8px;

    color: #313d50;

    font-size: 12px;
    font-weight: 600;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label-hint {
    color: #7c8799;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .7px;
}

.input-wrapper {
    position: relative;

    display: flex;
    align-items: center;
}

.input-wrapper > svg {
    position: absolute;
    left: 13px;

    width: 17px;
    height: 17px;

    fill: none;

    stroke: #8a96a8;
    stroke-width: 1.5;

    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 46px;

    padding: 0 43px;

    border: 1px solid var(--border);
    border-radius: 7px;

    outline: none;

    background: #fbfcfe;

    color: var(--text);

    font-size: 13px;

    transition:
        border-color .15s,
        box-shadow .15s,
        background .15s;
}

.input-wrapper input::placeholder {
    color: #a2acba;
}

.input-wrapper input:focus {
    border-color: var(--primary);

    background: white;

    box-shadow:
        0 0 0 3px rgba(23, 105, 224, .10);
}

.password-toggle {
    position: absolute;
    right: 10px;

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    background: transparent;

    color: #8a96a8;

    cursor: pointer;
}

.password-toggle svg {
    width: 17px;
    height: 17px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.5;
}

.code-wrapper input {
    letter-spacing: 5px;

    font-size: 16px;
    font-weight: 600;
}


/* ERROR */

.error-message {
    display: none;

    align-items: flex-start;

    gap: 9px;

    margin: 2px 0 17px;

    padding: 11px 12px;

    border: 1px solid #f3cccc;
    border-radius: 7px;

    background: var(--error-bg);

    color: var(--error);

    font-size: 11px;
    line-height: 1.45;
}

.error-message.visible {
    display: flex;
}

.error-message svg {
    flex: 0 0 auto;

    width: 16px;
    height: 16px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.7;
}


/* BUTTON */

.submit-button {
    position: relative;

    width: 100%;
    height: 46px;

    border: 0;
    border-radius: 7px;

    background: var(--primary);

    color: white;

    font-size: 13px;
    font-weight: 650;

    cursor: pointer;

    transition:
        background .15s,
        transform .05s,
        box-shadow .15s;
}

.submit-button:hover {
    background: var(--primary-dark);

    box-shadow:
        0 5px 14px rgba(23, 105, 224, .20);
}

.submit-button:active {
    transform: translateY(1px);
}

.submit-button:disabled {
    cursor: wait;
    opacity: .9;
}

.button-loader {
    display: none;

    justify-content: center;
    align-items: center;

    gap: 4px;
}

.button-loader span {
    width: 4px;
    height: 4px;

    border-radius: 50%;

    background: white;

    animation: loading .8s infinite ease-in-out;
}

.button-loader span:nth-child(2) {
    animation-delay: .12s;
}

.button-loader span:nth-child(3) {
    animation-delay: .24s;
}

.submit-button.loading .button-text {
    display: none;
}

.submit-button.loading .button-loader {
    display: flex;
}

@keyframes loading {
    0%, 100% {
        opacity: .35;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-2px);
    }
}


/* SECURITY */

.security-note {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    margin-top: 22px;

    color: #8792a3;

    font-size: 10px;
}

.security-note svg {
    width: 15px;
    height: 15px;

    fill: none;

    stroke: currentColor;
    stroke-width: 1.5;
}


/* FOOTER */

footer {
    height: 52px;

    padding: 0 42px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-top: 1px solid #e5eaf1;

    color: #8994a5;

    font-size: 10px;

    background: rgba(255,255,255,.65);
}

.footer-right {
    display: flex;
    gap: 9px;
}


/* MOBILE */

@media (max-width: 600px) {

    .topbar {
        padding: 0 18px;
    }

    .topbar-status {
        display: none;
    }

    .main {
        padding: 35px 15px;
    }

    .login-card {
        width: 100%;
        max-width: 430px;

        padding: 32px 25px 25px;
    }

    footer {
        padding: 0 18px;
    }

    .footer-right {
        display: none;
    }
}
