/* Login screen from mockups/version_2/login: wordmark, #111 card, segmented method switch, code cells. */
.app:has(.login-card) { width: 100%; margin: 0; padding: 0; }
#app-root:has(.login-card) { display: flex; min-height: 100svh; padding: 32px 24px; }
.login-screen { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: center; gap: 32px; }
.login-brand { display: inline-flex; align-items: baseline; gap: 5px; font-size: 30px; font-weight: 750; letter-spacing: -.065em; }
.login-brand-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.login-card { width: 520px; max-width: 100%; margin: auto 0; padding: 40px; border-radius: 36px; background: #111; animation: login-content-in .38s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes login-content-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.login-card :is(button, input, h1):focus { outline: none; }
.login-card button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Terms of the promo link the visitor came by, above the title. */
.login-promo { margin-bottom: 24px; padding: 16px 20px; border-radius: 22px; background: rgba(120, 214, 165, .09); }
.login-promo-title { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 17px; font-weight: 650; line-height: 1.35; }
.login-promo-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--green); }
.login-promo-copy { margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-promo.is-unavailable { background: #1b1b1b; }
.login-promo.is-unavailable .login-promo-title { color: #bdbdbd; }

.login-title { font-size: 36px; font-weight: 650; line-height: 1.15; letter-spacing: -.035em; }
.login-copy { margin-top: 12px; color: var(--muted); font-size: 17px; line-height: 1.5; }
.login-copy strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }

/* Segmented control with a sliding thumb. */
.login-methods { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; padding: 4px; border-radius: 999px; background: #202020; }
.login-methods::before { content: ""; position: absolute; z-index: -1; inset: 4px auto 4px 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--fill-control); transition: transform .32s cubic-bezier(.22, 1, .36, 1); }
.login-methods[data-method="email"]::before { transform: translateX(100%); }
.login-method { display: flex; min-height: 48px; align-items: center; justify-content: center; gap: 9px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 16px; font-weight: 600; transition: color .2s ease; }
.login-method svg { width: 19px; height: 19px; }
.login-method:hover { color: #ddd; }
.login-method[aria-pressed="true"] { color: #fff; }

.login-form { display: grid; margin-top: 24px; }
.login-input { width: 100%; height: 64px; padding: 0 22px; border: 0; border-radius: 20px; background: #202020; color: var(--text); font-size: 20px; transition: background-color .2s ease; }
.login-input::placeholder { color: #6f6f6f; }
.login-input:hover { background: #262626; }
.login-input:focus { background: #303030; }
.login-card input:disabled { opacity: .55; cursor: not-allowed; }
.login-hint { margin-top: 12px; color: #777; font-size: 14px; line-height: 1.5; }
.login-error { margin-top: 14px; color: #ff8585; font-size: 14px; line-height: 1.5; }
.login-error:empty { display: none; }

/* Quiet primary, as «Создать поиск» in the search dialog. */
.login-action { display: flex; width: 100%; min-height: 60px; align-items: center; justify-content: center; gap: 10px; margin-top: 28px; padding: 0 24px; border: 0; border-radius: 999px; background: #353535; color: var(--accent); font-size: 18px; font-weight: 650; transition: background-color .2s ease, color .2s ease; }
.login-action:hover:not(:disabled) { background: #414141; color: #ffdc85; }
.login-action:focus-visible { outline: none; background: #484848; }
.login-action:disabled { color: #8a8a8a; cursor: not-allowed; }
.login-expiry .login-action { margin-top: 0; }
/* Request in flight: same pill, spinner in front of the label, clicks ignored by the controller. */
.login-action.is-loading, .login-action.is-loading:hover:not(:disabled) { background: #353535; color: #b9b9b9; cursor: progress; }
.login-action.is-loading::before { content: ""; width: 20px; height: 20px; flex: none; border: 2.5px solid rgba(255, 255, 255, .18); border-top-color: var(--accent); border-radius: 50%; animation: login-spin .8s linear infinite; }
@keyframes login-spin { to { transform: rotate(360deg); } }
.login-input:read-only { color: #9a9a9a; }
.login-action.is-warning { margin-top: 0; background: var(--accent); color: #111; }
.login-action.is-warning:hover:not(:disabled) { background: #ffdc85; color: #111; }
.login-action.is-warning:focus-visible { background: #ffe39d; }
.login-action.is-warning:disabled { background: #353535; color: #8a8a8a; }

/* Secondary way back: a small pill above the title. */
.login-back { display: inline-flex; height: 36px; align-items: center; gap: 2px; margin: -6px 0 22px -4px; padding: 0 14px 0 8px; border: 0; border-radius: 999px; background: #1b1b1b; color: #999; font-size: 15px; font-weight: 600; transition: background-color .15s ease, color .15s ease; }
.login-back svg { width: 20px; height: 20px; stroke-width: 2.2; }
.login-back:hover { background: #242424; color: #fff; }
.login-back:focus-visible { outline: none; background: #2a2a2a; color: #fff; }

/* One real input for paste and one-time-code autofill, drawn as cells. */
.login-code-field { position: relative; display: grid; grid-template-columns: repeat(var(--code-length, 4), minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.login-code { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; color: transparent; caret-color: transparent; font-size: 16px; opacity: 0; cursor: text; }
.login-cell { display: grid; height: 84px; place-items: center; border-radius: 22px; background: #202020; color: #fff; font-size: 36px; font-weight: 650; font-variant-numeric: tabular-nums; transition: background-color .2s ease; }
.login-code-field:hover .login-cell { background: #262626; }
.login-code-field:has(.login-code:focus) .login-cell.is-active { background: #303030; }
.login-code-field:has(.login-code:focus) .login-cell.is-active:empty::after { content: ""; width: 2px; height: 36px; border-radius: 2px; background: #f5f5f5; animation: login-caret 1s steps(1) infinite; }
.login-code-field:has(.login-code:disabled) { opacity: .45; }
.login-code-field:has(.login-code:disabled) .login-code { cursor: not-allowed; }
.login-card .is-wrong { animation: login-shake .42s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes login-caret { 50% { opacity: 0; } }
@keyframes login-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.login-expiry { margin-top: 28px; color: #8a8a8a; font-size: 15px; text-align: center; font-variant-numeric: tabular-nums; }

@media (max-width: 540px) {
  #app-root:has(.login-card) { padding: 20px 16px 24px; }
  .login-screen { align-items: stretch; gap: 40px; }
  .login-brand { font-size: 26px; }
  .login-card { margin: 0; padding: 0; border-radius: 0; background: transparent; }
  .login-title { font-size: 30px; }
  .login-promo { padding: 14px 16px; border-radius: 18px; }
  .login-copy { font-size: 16px; }
  .login-method { font-size: 15px; }
  .login-code-field { gap: 10px; }
  .login-cell { height: 76px; border-radius: 20px; font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { .login-card, .login-card *, .login-card *::before, .login-card *::after { transition: none !important; animation: none !important; } }
