.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top, var(--bg-page-accent) 0%, transparent 55%),
        var(--bg-page);
}

.app-header {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100;
    padding: 0;
}

.app-header__tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
}

.lang-switcher__btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0.55;
    transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.lang-switcher__btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.lang-switcher__btn.is-active {
    opacity: 1;
    background: var(--bg-button-secondary);
    box-shadow: inset 0 0 0 1px var(--border-input);
}

.lang-switcher__btn img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: block;
    object-fit: cover;
}

.page-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 88px 16px 40px;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    background: var(--bg-button-secondary);
}

.theme-toggle__icon {
    font-size: 1.1rem;
    line-height: 1;
}

[data-theme="light"] .theme-toggle__icon--moon,
[data-theme="dark"] .theme-toggle__icon--sun {
    display: none;
}

.logo-app {
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.app-footer {
    margin-top: auto;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.install-app-btn {
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.install-app-btn:hover {
    background: var(--bg-button-secondary);
    transform: translateY(-1px);
}

.app-version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: var(--shadow-card);
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card--center {
    text-align: center;
}

.logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo {
    display: block;
    color: var(--logo-color);
}

.page-title {
    font-size: 1.85rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.page-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.alert-error {
    background: var(--alert-error-bg);
    border: 1px solid var(--alert-error-border);
    color: var(--alert-error-text);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.field-input {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--border-input);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.25s ease;
}

.field-input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--border-focus) 12%, transparent);
}

.field-input::placeholder {
    color: var(--text-muted);
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.captcha-field {
    flex: 1;
}

.captcha-image-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.captcha-image {
    display: block;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: var(--bg-captcha);
}

.captcha-refresh {
    width: 34px;
    height: 30px;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    background: var(--bg-button-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background-color 0.15s ease;
}

.captcha-refresh:hover {
    background: var(--bg-page-accent);
}

.btn-primary {
    width: 100%;
    margin-top: 4px;
    padding: 13px 16px;
    border: none;
    border-radius: 999px;
    background: var(--btn-primary-bg);
    color: var(--text-inverse);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    transform: translateY(-1px);
}

.btn-primary.btn-inline {
    width: auto;
    min-width: 160px;
}

.dashboard-text {
    color: var(--text-secondary);
    margin-bottom: 28px;
    line-height: 1.7;
}

.dashboard-text strong {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .card {
        padding: 26px 20px;
        border-radius: 16px;
    }

    .captcha-row {
        flex-direction: column;
        align-items: stretch;
    }

    .captcha-image-wrap {
        flex-direction: row;
        justify-content: space-between;
    }
}
