/* Login flat */
:root {
    --lf-bg: #1a1d24;
    --lf-input: #252a33;
    --lf-text: #ffffff;
    --lf-muted: #8b93a7;
    --lf-green: #20c997;
    --lf-green-hover: #1ab386;
    --lf-radius: 6px;
    --lf-pad: 16px;
    --lf-max: 450px;
}

html.login-page--flat {
    background: #ffffff !important;
    padding: 0;
}

body.login-page--flat {
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background: #ffffff !important;
    box-shadow: none;
    color: var(--lf-text);
    font-family: 'Times New Roman', Times, serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Cột form tối, nền ngoài trắng */
.login-flat__shell {
    width: 100%;
    max-width: var(--lf-max);
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background: var(--lf-bg);
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Header tối + logo — chừa safe-area iOS (Web Clip / PWA standalone) */
.login-flat__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    width: 100%;
    flex-shrink: 0;
    min-height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) var(--lf-pad) 0;
    background: #0f1419;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.login-flat__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.login-flat__logo-svg {
    display: block;
    height: 30px;
    width: auto;
}

.login-flat__logo .logo-fill-main {
    fill: #ffffff;
}

.login-flat__logo .logo-fill-accent {
    fill: #0ecb81;
}

.login-flat__lang {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    background: transparent;
    overflow: hidden;
    flex-shrink: 0;
}

.login-flat__lang svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 50%;
}

.login-flat {
    width: 100%;
    flex: 1;
    background: var(--lf-bg);
    box-sizing: border-box;
}

.login-flat__body {
    padding: 20px var(--lf-pad) 40px;
}

.login-flat__tabs {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.login-flat__tab {
    font-size: 15px;
    font-weight: 500;
    color: var(--lf-muted);
    text-decoration: none;
    padding: 0 0 12px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s;
}

.login-flat__tab:hover {
    color: var(--lf-text);
}

.login-flat__tab--active {
    color: var(--lf-text);
    font-weight: 600;
    border-bottom-color: var(--lf-text);
}

.login-flat__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.login-flat__input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: none;
    border-radius: var(--lf-radius);
    background: var(--lf-input);
    color: var(--lf-text);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.login-flat__input::placeholder {
    color: var(--lf-muted);
    opacity: 1;
    font-size: 13px;
}

.login-flat__input:focus {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.login-flat__captcha {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.login-flat__captcha .login-flat__input {
    flex: 1;
    min-width: 0;
    font-size: 12px;
    padding: 0 10px;
}

.login-flat__captcha .login-flat__input::placeholder {
    font-size: 12px;
}

.login-flat__captcha-img {
    width: 96px;
    height: 46px;
    border-radius: var(--lf-radius);
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
    display: block;
}

.login-flat__btn {
    width: 100%;
    height: 46px;
    margin-top: 8px;
    border: none;
    border-radius: var(--lf-radius);
    background: var(--lf-green);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-flat__btn:hover {
    background: var(--lf-green-hover);
}

.login-flat__btn:disabled,
.login-flat__btn.is-loading {
    opacity: 0.75;
    cursor: not-allowed;
}

.login-flat__btn .btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lf-spin 0.7s linear infinite;
}

.login-flat__btn.is-loading .btn-spinner {
    display: block;
}

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

.login-flat__forgot {
    margin-top: 4px;
    font-size: 13px;
    color: var(--lf-muted);
    text-decoration: none;
    align-self: flex-start;
}

.login-flat__forgot:hover {
    color: var(--lf-text);
}

.login-flat__check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--lf-muted);
    line-height: 1.45;
    cursor: pointer;
    margin-top: 4px;
}

.login-flat__check input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    margin-top: 2px;
    accent-color: var(--lf-green);
    cursor: pointer;
}

.login-flat__check a {
    color: var(--lf-text);
    text-decoration: none;
}

.login-flat__footer {
    margin-top: 16px;
    font-size: 13px;
    color: var(--lf-muted);
    text-align: center;
}

.login-flat__footer a {
    color: var(--lf-green);
    text-decoration: none;
    font-weight: 500;
}

.login-flat__footer a:hover {
    text-decoration: underline;
}

.lang-modal {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: var(--lf-max);
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.65);
    z-index: 999;
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(80px + env(safe-area-inset-top, 0px));
    box-sizing: border-box;
}

.lang-modal.is-open {
    display: flex;
}

.lang-content {
    background: #252a33;
    width: 90%;
    max-width: var(--lf-max);
    border-radius: 10px;
    overflow: hidden;
}

.lang-content__list {
    max-height: min(60vh, 400px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lang-content__title {
    padding: 14px 18px;
    font-size: 13px;
    color: var(--lf-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lang-item {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    color: var(--lf-text);
    font-size: 14px;
}

.lang-item:last-child {
    border-bottom: none;
}

.lang-item:hover {
    background: rgba(32, 201, 151, 0.1);
}
