@font-face {
    font-family: "BPG-Arial";
    src: url("/fonts/bpg_aria.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

form {
    width: 100%;
}

.hidden-form {
    visibility: hidden;
    display: none;
}

body {
    font-family: "BPG-Arial", sans-serif;
    min-height: 100vh;
    background-image: url("/images/todua_background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-family: "Noto Sans Georgian", sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
}

.login_box,
.auth-card {
    background-color: #FFFFFF;
    width: 90%;
    max-width: 450px;
    border-radius: 8px;
    padding: 20px;
    padding-left: 30px !important;
    padding-right: 30px !important;
    padding-bottom: 40px;
    box-sizing: border-box;
}

.auth-card {
    max-width: 460px;
}

.auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 18px;
    padding: 4px;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
}

.auth-switch-btn {
    border: 0;
    border-radius: 6px;
    height: 42px;
    cursor: pointer;
    background: transparent;
    color: #0d2b49;
    font-family: "BPG-Arial", sans-serif;
    font-weight: 600;
}

.auth-switch-btn.active {
    background-color: #ffc43b;
    color: #ffffff;
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.register-toggle {
    border: none;
    background: transparent;
    color: #0d2b49;
    cursor: pointer;
    font-family: "BPG-Arial", sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-top: 6px;
    text-align: center;
    text-decoration: underline;
}

.register-toggle.secondary {
    color: #6b7280;
    margin-top: 0;
}

.register-panel {
    display: none;
}

.login_label {
    font-family: "BPG-Arial", sans-serif;
    font-weight: 600;
}

.stack-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stack-horizontal {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.login_logo {
    height: 45px;
    width: 250px;
    margin: 10px auto 0;
}

.input-wrapper {
    border-radius: 8px;
    border: 1px solid #e7e7e7;
    height: 50px;
    width: 100%;
    display: flex;
    justify-content: left;
    align-items: center;
}

.input-wrapper > input {
    outline: none;
    border-style: none;
    border-left: 2px solid #e7e7e7 !important;
    height: 20px;
    font-size: 16px;
    width: 100%;
    padding-left: 10px;
    font-family: "BPG-Arial", sans-serif;
    background-color: transparent;
}

.input-wrapper > input:first-child {
    border-left: none !important;
    padding-left: 15px;
}

.input-wrapper > img {
    height: 22px;
    width: 22px;
    margin: 0px 0px 0px 15px !important;
}

.form-group {
    margin-top: 20px;
}

.login_button {
    background-color: #ffc43b;
    cursor: pointer;
    border-style: none;
    height: 50px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;

}

.login_button > span {
    font-weight: 600;
    color: #fffcff;
    font-size: 14px;
    font-family: "BPG-Arial", sans-serif;

}

.login_error_message {
    border-radius: 8px;
    height: 50px;
    width: 100%;
    border: 1px solid #f2aeb5;
    background-color: #f7d7da;
    display: flex;
    justify-content: left;
    align-items: center;
}

.login_error_message > span {
    font-family: "BPG-Arial", sans-serif;
    font-weight: 400;
    color: #58151c;
    margin-left: 10px;
}

.code_input {
    outline: none;
    border-style: none;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    height: 48px;
    size: 14px;
    width: 40px;
    font-family: "BPG-Arial", sans-serif;
    font-size: 28px;
    text-align: center;
    margin-right: 5px;
}

.code_input_wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.code_note {
    color: #3d3d3d !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    font-family: "BPG-Arial", sans-serif;
}

.login_success_message {
    border-radius: 8px;
    min-height: 50px;
    width: 100%;
    border: 1px solid #b7dfc2;
    background-color: #d8f3df;
    display: flex;
    justify-content: left;
    align-items: center;
    margin-top: 14px;
}

.login_success_message > span {
    font-family: "BPG-Arial", sans-serif;
    font-weight: 400;
    color: #0f5132;
    margin-left: 10px;
}

@media (max-width: 640px) {
    html,
    body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        align-items: center;
        justify-content: center;
        padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: auto;
        background-position: center top;
        touch-action: pan-y;
        -webkit-text-size-adjust: 100%;
    }

    .login_box,
    .auth-card {
        width: 100%;
        max-width: min(420px, calc(100vw - 28px));
        margin: 0 auto;
        padding: 20px 18px 26px !important;
        border-radius: 14px;
        box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
        overflow: hidden;
    }

    .login_box *,
    .auth-card * {
        max-width: 100%;
    }

    .stack-horizontal {
        width: 100%;
        min-width: 0;
    }

    .login_logo {
        width: min(240px, 78vw);
        height: auto;
        min-height: 42px;
        object-fit: contain;
        margin-top: 0;
    }

    .form-group {
        margin-top: 14px;
    }

    .stack-vertical {
        gap: 10px;
    }

    .input-wrapper {
        height: 48px;
        min-width: 0;
        border-radius: 12px;
    }

    .input-wrapper > input {
        min-width: 0;
        font-size: 16px;
    }

    .input-wrapper > input::placeholder {
        font-size: 16px;
    }

    .login_button {
        height: 50px;
        width: 100%;
        border-radius: 12px;
    }

    .register-toggle {
        padding: 8px 4px;
        line-height: 1.4;
    }

    .login_error_message,
    .login_success_message {
        min-height: 46px;
        height: auto;
        padding: 10px 0;
        box-sizing: border-box;
    }

    .login_error_message > span,
    .login_success_message > span {
        margin-right: 10px;
        line-height: 1.4;
    }

    .code_input {
        width: 100%;
        max-width: 46px;
        height: 46px;
        min-width: 0;
        font-size: 24px;
        margin-right: 0;
        border-radius: 12px;
        justify-self: center;
    }

    .code_input_wrapper {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        justify-content: stretch;
        min-width: 0;
        padding: 2px 0;
    }

    .code_note,
    .login_label {
        line-height: 1.45;
        word-break: break-word;
    }
}

@media (max-width: 380px) {
    body {
        padding: 12px 10px;
    }

    .login_box {
        padding: 16px 14px 22px !important;
    }

    .input-wrapper > input,
    .input-wrapper > input::placeholder {
        font-size: 16px;
    }

    .code_input {
        max-width: 40px;
        height: 44px;
        font-size: 22px;
    }

    .code_input_wrapper {
        gap: 6px;
    }
}
