@font-face {
    font-family: Opensans;
    src: url('../fonts/opensans.ttf');
}
@font-face {
    font-family: Opensansl;
    src: url('../fonts/opensans-light.ttf');
}
@font-face {
    font-family: Opensansb;
    src: url('../fonts/opensans-bold.ttf');
}

:root {
    --auth-green: #16c864;
    --auth-green-dark: #0eaa50;
    --auth-text: #33383f;
    --auth-muted: #737b88;
    --auth-border: #cfd4dc;
    --auth-border-soft: #e7eaf0;
    --auth-bg: #f7f8fa;
    --auth-white: #ffffff;
    --auth-danger: #e0294a;
}

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

body.bg {
    margin: 0;
    min-height: 100vh;
    color: var(--auth-text);
    background:
        radial-gradient(circle at 14% 22%, rgba(22, 200, 100, .045), transparent 26%),
        radial-gradient(circle at 88% 72%, rgba(22, 200, 100, .035), transparent 24%),
        linear-gradient(180deg, #fafbfc 0%, #f5f7f9 100%);
    font-family: Opensans, Arial, sans-serif;
}

body.bg::before,
body.bg::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
    width: 42vw;
    height: 42vw;
    border: 1px solid rgba(123, 134, 149, .07);
    border-radius: 50%;
}
body.bg::before {
    left: -27vw;
    top: 36vh;
}
body.bg::after {
    right: -28vw;
    top: 22vh;
}

.auth-page {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 28px 20px 40px;
    box-sizing: border-box;
}

.auth-shell {
    width: 100%;
    max-width: 520px;
    margin: auto;
}

.auth-brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 22px;
}
.auth-brand img {
    display: block;
    width: 150px;
    max-height: 72px;
    object-fit: contain;
}

.auth-card {
    background: rgba(255,255,255,.97);
    border: 1px solid var(--auth-border-soft);
    border-radius: 6px;
    box-shadow: 0 10px 34px rgba(28, 37, 48, .08);
    padding: 34px 38px 30px;
}

.auth-title {
    margin: 0;
    text-align: center;
    font-family: Opensansb, Opensans, Arial, sans-serif;
    font-size: 31px;
    line-height: 1.2;
    font-weight: 700;
    color: #4b4f55;
}

.auth-subtitle {
    margin: 9px 0 24px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.45;
}

.login__form,
.auth-form {
    width: 100%;
    display: block;
    position: relative;
}

.login__fieldset,
.auth-fields {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.auth-field,
.login__input-container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.auth-input,
.login__input,
.auth-select-button,
.auth-phone-prefix {
    width: 100%;
    height: 52px;
    box-sizing: border-box;
    border: 1px solid #9fa5ad;
    border-radius: 3px;
    background: #fff;
    color: #474c53;
    font-family: Opensans, Arial, sans-serif;
    font-size: 15px;
    line-height: 1;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-input,
.login__input {
    padding: 0 14px;
}
.auth-input.has-left-icon {
    padding-left: 42px;
}
.auth-input.has-right-icon {
    padding-right: 48px;
}

.auth-input::placeholder,
.login__input::placeholder {
    color: #8b9098;
    opacity: 1;
}

.auth-input:focus,
.login__input:focus,
.auth-select-button:focus,
.auth-select-button.is-open,
.auth-phone-prefix:focus,
.auth-phone-prefix.is-open {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 3px rgba(22, 200, 100, .11);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: #474c53 !important;
    -webkit-box-shadow: 0 0 0 40px #fff inset !important;
    transition: background-color 9999s ease-out 0s;
}

.auth-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b929d;
    font-size: 21px;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

.password-toggle-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #707781;
    font-size: 25px;
    line-height: 1;
    z-index: 3;
}
.password-toggle-icon:hover { color: var(--auth-green-dark); }

.auth-helper {
    margin: -6px 0 2px;
    color: #666d77;
    font-size: 12px;
    line-height: 1.45;
}

/* Country selector */
.auth-country-wrap {
    position: relative;
}
.auth-select-button,
.auth-phone-prefix {
    padding: 0 42px 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    position: relative;
}
.auth-select-button::after,
.auth-phone-prefix::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2px solid #72777e;
    border-bottom: 2px solid #72777e;
    transform: rotate(45deg) translateY(-3px);
    position: absolute;
    right: 17px;
    top: 50%;
}
.auth-country-flag {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
    flex: 0 0 auto;
}
.auth-country-dropdown {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: 286px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #cfd3d9;
    box-shadow: 0 12px 30px rgba(30, 40, 52, .14);
    display: none;
}
.auth-country-dropdown.is-open { display: block; }
.auth-country-option {
    width: 100%;
    border: 0;
    background: #fff;
    min-height: 42px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    color: #565b61;
    font: 14px Opensans, Arial, sans-serif;
    text-align: left;
}
.auth-country-option:hover,
.auth-country-option.is-selected {
    background: #eef0f2;
}
.auth-country-option img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.auth-country-code {
    margin-left: auto;
    color: #89909a;
    font-size: 12px;
}

.auth-phone-row {
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
    gap: 0;
}
.auth-phone-row .auth-phone-prefix {
    border-radius: 3px 0 0 3px;
    border-right: 0;
}
.auth-phone-row .auth-input {
    border-radius: 0 3px 3px 0;
}
.auth-phone-prefix {
    padding-left: 12px;
    padding-right: 30px;
    gap: 7px;
}
.auth-phone-prefix .auth-country-flag { width: 20px; height: 20px; }
.auth-phone-prefix::after { right: 12px; }

.auth-terms {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    align-items: flex-start;
    margin-top: 2px;
    color: #59616b;
    font-size: 12px;
    line-height: 1.55;
    cursor: pointer;
}
.auth-terms input {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--auth-green);
}
.auth-link,
.login__link {
    color: var(--auth-green-dark);
    text-decoration: none;
    font-family: Opensans, Arial, sans-serif;
}
.auth-link:hover,
.login__link:hover {
    color: #078e41;
    text-decoration: underline;
}

.login__button,
.auth-primary-button {
    width: 100%;
    min-height: 51px;
    border: 0;
    border-radius: 2px;
    background: var(--auth-green);
    color: #fff;
    font-family: Opensansb, Opensans, Arial, sans-serif;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.login__button:not(:disabled):hover,
.auth-primary-button:not(:disabled):hover {
    background: var(--auth-green-dark);
    box-shadow: 0 8px 18px rgba(22, 200, 100, .16);
    transform: translateY(-1px);
}
.login__button:disabled,
.auth-primary-button:disabled,
button[disabled] {
    opacity: .56;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    background: #adb1b7;
}

.login__button-container,
.auth-button-wrap {
    width: 100%;
    position: relative;
    margin-top: 2px;
}

.login__error-message {
    margin: 9px 0 0;
    padding: 0;
    color: var(--auth-danger);
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
}

.loading {
    position: absolute;
    width: 23px;
    height: 23px;
    right: 15px;
    top: 14px;
    display: none;
    border: 3px solid rgba(255,255,255,.45);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-bottom-line,
.login__text-container {
    margin-top: 17px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    text-align: center;
    font-size: 13px;
}
.login__text,
.auth-bottom-line span {
    margin: 0;
    color: #666d76;
    font-family: Opensans, Arial, sans-serif;
    font-size: 13px;
}

.auth-login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 1px 0 2px;
}
.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #666d76;
    font-size: 13px;
    cursor: pointer;
}
.auth-remember input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-green);
    margin: 0;
}
.auth-forgot {
    font-size: 13px;
}

.auth-risk {
    margin: 18px auto 0;
    background: rgba(255,255,255,.75);
    border: 1px solid #dfe3e8;
    border-radius: 4px;
    padding: 14px 18px;
    color: #68707b;
    text-align: center;
    font-size: 11px;
    line-height: 1.45;
}
.auth-risk strong {
    display: block;
    margin-bottom: 4px;
    color: #454a52;
    font-size: 12px;
}

/* Legacy auth templates such as 2FA/remind inherit the white theme */
.login__container {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
}
.login__form-wrapper {
    width: 100%;
    max-width: 470px;
}
.login__form-wrapper > .login__form,
.login__form-wrapper form.login__form {
    box-sizing: border-box;
}
.login__title {
    color: #4b4f55;
    font-size: 28px;
    font-family: Opensansb, Opensans, Arial, sans-serif;
}
.login__input-label {
    color: #5a6068;
    font-size: 13px;
}
.hide { display: none !important; }

@media (max-width: 640px) {
    .auth-page {
        padding: 18px 12px 26px;
        align-items: flex-start;
    }
    .auth-shell { margin-top: 8px; }
    .auth-brand { margin-bottom: 14px; }
    .auth-brand img { width: 132px; }
    .auth-card {
        padding: 26px 20px 24px;
        border-radius: 5px;
        box-shadow: 0 8px 24px rgba(28,37,48,.06);
    }
    .auth-title { font-size: 27px; }
    .auth-subtitle { font-size: 13px; margin-bottom: 21px; }
    .auth-input,
    .login__input,
    .auth-select-button,
    .auth-phone-prefix { height: 50px; font-size: 14px; }
    .auth-phone-row { grid-template-columns: 112px minmax(0,1fr); }
    .auth-login-actions { align-items: flex-start; }
    .auth-risk { margin-top: 14px; }
}

@media (max-width: 390px) {
    .auth-page { padding-left: 8px; padding-right: 8px; }
    .auth-card { padding-left: 15px; padding-right: 15px; }
    .auth-phone-row { grid-template-columns: 106px minmax(0,1fr); }
    .auth-country-code { display: none; }
    .auth-login-actions { gap: 10px; }
}
