/* Devise authentication pages (sign in / sign up / password reset / confirm).
 *
 * The layout wraps the Devise view in a split-panel card: a dark brand panel
 * (.auth-brand) beside the form panel (.auth-panel) that renders `yield`.
 * Form markup comes from the Devise views (.field / .actions / .oauth-button /
 * .auth-links / .auth-divider), scoped here under .auth-panel. */

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* --- Brand panel ------------------------------------------------------- */
.auth-brand {
  display: flex;
  flex-direction: column;
  padding: 48px 44px;
  background: var(--ink);
  color: #fff;
}

.auth-brand__logo.brand,
.auth-brand__logo.brand:hover {
  color: #fff;
}

/* Dark panel: match the wordmark accent to the mark's lighter blue. */
.auth-brand__logo .brand__accent {
  color: #5B8AE0;
}

/* Fixed gap under the logo so the headline sits at the same offset on every
 * auth page — the panel stretches to the form's height, so a distributed
 * (space-between) layout would drift the text down on the taller sign-up form. */
.auth-brand__body {
  margin-top: 72px;
}

/* Keep the security note pinned to the bottom without moving the body. */
.auth-brand__foot {
  margin-top: auto;
  padding-top: 32px;
}

.auth-brand__title {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.auth-brand__lead {
  font-size: 15px;
  line-height: 1.6;
  color: #A6ACBE;
  margin-bottom: 24px;
}

.auth-brand__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-brand__features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #C4C8D2;
}

.auth-brand__ficon {
  flex-shrink: 0;
  color: #7C8CF5;
}

/* Work-in-progress features: clock icon, dimmed text and a "скоро" pill so they
 * read as planned rather than already available (the check-marked ones).
 * Currently unused — kept for the next feature that ships as "soon". */
.auth-brand__features li.is-soon {
  color: #838BA0;
}

.auth-brand__features li.is-soon .auth-brand__ficon {
  color: #838BA0;
}

.auth-brand__soon {
  margin-left: auto;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #B4BAC7;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.auth-brand__foot {
  font-size: 13px;
  color: #6E7488;
}

/* --- Form panel -------------------------------------------------------- */
.auth-panel {
  padding: 48px 44px;
}

.auth-panel h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Pages without a subtitle (password reset, account edit) put the form right
 * after the title — restore the breathing room the subtitle would give. */
.auth-panel h2 + form {
  margin-top: 16px;
}

/* "Нет аккаунта? Зарегистрироваться" / "Уже есть аккаунт? Войти" under the title. */
.auth-subtitle {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--muted);
}

/* Inline text links inside the form (subtitle, forgot password, terms).
 * Pin the size so links match regardless of context — the forgot-password
 * link sits in the password row and would otherwise inherit the 16px body size,
 * while the subtitle link inherits 14px. */
.lnk {
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.lnk:hover {
  text-decoration: underline;
}

.auth-panel > form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Fields */
.auth-panel .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

/* Label + inline action (e.g. "Пароль" ... "Забыли пароль?") on one row. */
.auth-panel .field__labelrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-panel .field label {
  font-size: 13px;
  font-weight: 600;
  color: #3A4256;
}

.auth-panel .field em {
  font-size: 12.5px;
  color: var(--muted-2);
  font-style: normal;
}

.auth-panel .field input[type="email"],
.auth-panel .field input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 12px 15px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.auth-panel .field input[type="email"]:focus,
.auth-panel .field input[type="password"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(61, 80, 224, 0.14);
}

/* Remember-me row */
.auth-panel .field--inline {
  flex-direction: row;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-panel .field--inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.auth-panel .field--inline label {
  margin: 0;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

/* Terms-of-use acceptance checkbox on the sign-up form. */
.auth-panel .field-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
}

.auth-panel .field-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Primary submit */
.auth-panel .actions {
  margin: 6px 0 0;
}

.auth-panel .actions input[type="submit"] {
  width: 100%;
  height: 50px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: filter 0.16s ease;
}

.auth-panel .actions input[type="submit"]:hover {
  filter: brightness(1.07);
}

/* "или" divider between password form and OAuth buttons */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--muted-2);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #EAECF1;
}

/* Google / OAuth button */
.auth-panel form.button_to {
  margin: 0;
}

button.oauth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

button.oauth-button:hover {
  background: #FBFBFC;
  border-color: var(--border-dashed);
}

.oauth-button .oauth-icon {
  flex-shrink: 0;
}

/* Secondary links (register / sign in / forgot password) */
.auth-links {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 16px;
}

.auth-panel .auth-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  transition: border-color 0.16s ease, background-color 0.16s ease;
}

.auth-panel .auth-links a:hover {
  background: #FBFBFC;
  border-color: var(--border-dashed);
}

/* Validation errors */
.auth-panel #error_explanation {
  padding: 14px 16px;
  margin-bottom: 4px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 11px;
  color: #96261d;
}

.auth-panel #error_explanation h2 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #96261d;
}

.auth-panel #error_explanation ul {
  margin: 0;
  padding-left: 18px;
}

.auth-panel #error_explanation li {
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 760px) {
  .auth-split {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-panel {
    padding: 36px 26px;
  }
}
