* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #38bdf8 0%, #f9a8d4 100%);
    color: #334155;
}
.login-shell {
    height: 100%;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 16px 0;
}
.card {
    width: 100%;
    max-width: 400px;
    margin: auto 0;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid #fff;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    max-height: calc(100dvh - 72px);
    overflow: auto;
}
h1 {
    margin: 0 0 8px;
    font-size: 28px;
    text-align: center;
}
p.sub {
    margin: 0 0 20px;
    text-align: center;
    font-size: 14px;
    color: #64748b;
}
.tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 20px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
}
.tabs button {
    border: 0;
    background: transparent;
    border-radius: 999px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
}
.tabs button.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
label {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
}
input {
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 14px;
    outline: none;
    background: #fff;
}
.password-wrap {
    display: block;
    position: relative;
    margin-top: 6px;
}
.password-wrap input {
    margin-top: 0;
    padding-right: 44px;
}
.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
}
.password-toggle:hover {
    color: #64748b;
    background: #f1f5f9;
}
.password-toggle .hidden {
    display: none;
}
input:focus {
    border-color: #38bdf8;
}
button.submit {
    width: 100%;
    margin-top: 8px;
    padding: 12px 16px;
    border: 0;
    border-radius: 999px;
    background: #0ea5e9;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.msg {
    margin: 0 0 12px;
    font-size: 13px;
    text-align: center;
}
.msg.error {
    color: #e11d48;
}
.msg.ok {
    color: #0d9488;
}
.hidden {
    display: none !important;
}
.accounts {
    margin-bottom: 8px;
}
.accounts-title {
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
}
.accounts-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 20px;
    margin-bottom: 12px;
}
.account-item {
    position: relative;
    width: 100px;
}
.account-row {
    margin: 0;
}
.account-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.account-btn:hover:not(:disabled) .account-avatar {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35);
}
.account-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.account-avatar {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}
.account-avatar-fallback,
.account-avatar-add {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
}
.account-avatar-fallback {
    color: #fff;
    background: linear-gradient(145deg, #e11d48, #9f1239);
}
.avatar-tone-0 { background: linear-gradient(145deg, #e11d48, #9f1239); }
.avatar-tone-1 { background: linear-gradient(145deg, #ea580c, #c2410c); }
.avatar-tone-2 { background: linear-gradient(145deg, #d97706, #92400e); }
.avatar-tone-3 { background: linear-gradient(145deg, #16a34a, #15803d); }
.avatar-tone-4 { background: linear-gradient(145deg, #0891b2, #0e7490); }
.avatar-tone-5 { background: linear-gradient(145deg, #2563eb, #1d4ed8); }
.avatar-tone-6 { background: linear-gradient(145deg, #7c3aed, #5b21b6); }
.avatar-tone-7 { background: linear-gradient(145deg, #db2777, #9d174d); }
.account-avatar-add {
    background: #f1f5f9;
    color: #64748b;
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
}
.account-add-btn:hover .account-avatar-add {
    background: #e0f2fe;
    color: #0369a1;
}
.account-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
    line-height: 1.25;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account-email {
    font-size: 11px;
    font-weight: 400;
    color: #64748b;
    text-align: center;
    line-height: 1.2;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.manage-accounts {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 4px 0 2px;
    padding: 10px;
    border-radius: 999px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.manage-accounts:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.use-another,
.back-accounts {
    display: block;
    width: 100%;
    margin: 4px 0 8px;
    padding: 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #0ea5e9;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}
.use-another:hover,
.back-accounts:hover {
    background: #f0f9ff;
}
.card-wide {
    max-width: 520px;
}
.manage-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 8px;
}
.manage-card {
    display: flex;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}
.manage-avatar-wrap {
    flex-shrink: 0;
}
.manage-avatar {
    width: 72px;
    height: 72px;
}
.manage-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.manage-email {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.manage-name-readonly {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}
.manage-hint {
    margin: 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.35;
}
.manage-label {
    display: block;
    margin: 0;
}
.manage-name-form,
.manage-photo-form,
.manage-photo-remove,
.manage-forget-form {
    margin: 0;
}
.manage-save {
    margin-top: 8px;
}
.manage-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.manage-file-btn:hover {
    background: #bae6fd;
}
.manage-link-btn,
.manage-remove-btn {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.manage-link-btn {
    color: #64748b;
}
.manage-link-btn:hover {
    color: #0f172a;
}
.manage-remove-btn {
    color: #e11d48;
    margin-top: 4px;
}
.manage-remove-btn:hover {
    text-decoration: underline;
}
.page-footer {
    flex-shrink: 0;
    width: 100%;
    max-width: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 12px 8px 16px;
}
.legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
}
.legal-links a {
    font-size: 12px;
    color: rgba(15, 23, 42, 0.55);
    text-decoration: none;
}
.legal-links a:hover {
    color: #0f172a;
    text-decoration: underline;
}
.lang-dropdown {
    position: relative;
}
.lang-current {
    min-width: 40px;
    padding: 4px 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
}
.lang-current:hover,
.lang-dropdown.open .lang-current {
    background: #fff;
}
.lang-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-direction: column;
    min-width: 56px;
    padding: 4px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    z-index: 5;
}
.lang-opt {
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}
.lang-opt:hover {
    background: #f1f5f9;
    color: #0f172a;
}
.lang-opt.active {
    color: #0369a1;
    background: #e0f2fe;
}
.blocked-page .card {
    text-align: center;
}
.blocked-icon {
    font-size: 48px;
    line-height: 1;
    margin: 8px 0 16px;
}
.blocked-text {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.5;
    color: #334155;
}
.blocked-hint {
    margin: 0 0 20px;
    font-size: 13px;
    color: #94a3b8;
}
.retry-link {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}
