/* /assets/css/auth.css
   Auth layout and auth-specific OTP/form states.
*/

.auth{
  --navy: var(--ui-accent);
  --green: var(--ui-success);
  --purple: #5a4f6a;
  --text: var(--ui-text);
  --muted: var(--ui-muted);
  --line: var(--ui-border);
  --bg: var(--ui-surface);

  padding: 14px 0 18px;
}

.auth .container{ max-width: 620px; }

/* Card */
.auth__wrap{ display:flex; justify-content:center; }
.auth-card{
  width:100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: none;
  overflow:hidden;
}

/* Header */
.auth-head{
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.auth-head__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.auth-head__title{
  margin:0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  color: var(--ui-text);
}
.auth-head__badge{
  flex:0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  background: var(--purple);
  border-radius: 999px;
  padding: 6px 10px;
}
.auth-head__subtitle{
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}

/* Alerts */
.auth-alert{
  margin: 12px 14px 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  display:flex;
  gap: 10px;
  align-items:flex-start;
}
.auth-alert__icon{
  flex:0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.04);
  font-size: 14px;
}
.auth-alert__title{
  font-weight: 900;
  margin: 0 0 2px;
  font-size: 13px;
  color: #1f2a26;
}
.auth-alert__text{
  margin:0;
  font-size: 13px;
  line-height: 1.35;
}
.auth-alert__list{
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.35;
}

.auth-alert--ok{
  border-color: rgba(31,122,79,.24);
  background: rgba(247, 251, 249, .98);
}
.auth-alert--ok .auth-alert__icon{
  background: var(--ui-success-soft);
}
.auth-alert--err{
  border-color: rgba(180,35,24,.24);
  background: rgba(252, 247, 246, .98);
}
.auth-alert--err .auth-alert__icon{
  background: var(--ui-danger-soft);
}

/* Form */
.auth-form{ padding: 12px 14px 14px; }

.auth-block{
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 12px;
}

.auth-block__title{
  font-size: 13px;
  font-weight: 900;
  color:#1f2a26;
  margin: 0 0 10px;
}

.auth-label{
  display:block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
  color:#1f2a26;
}

.auth-hint{
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

/* Tabs */
.auth-tabs{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-tab__input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.auth-tab__btn{
  display:flex;
  align-items:center;
  justify-content:center;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  font-weight: 900;
  color: var(--ui-text);
  user-select:none;
  cursor:pointer;
}
.auth-tab__input:checked + .auth-tab__btn{
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color:#fff;
}
.auth-tab__input:disabled + .auth-tab__btn{
  opacity:.62;
  cursor:not-allowed;
}

/* Inputs */
.auth-field{ display:block; }
.auth-input{
  width:100%;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--ui-border);
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  background:#fff;
  box-sizing:border-box;
}
.auth-input:focus{
  border-color: rgba(37,72,168,.34);
  box-shadow: var(--ui-focus-ring);
}
.auth-input[readonly]{
  background: var(--ui-surface-muted);
}
.auth-mini{
  margin-top: 8px;
  font-size: 12px;
  color: var(--ui-muted-strong);
}

/* OTP layout — ALWAYS 6 cells */
.auth-input--hidden{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}

.auth-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.auth-row__left{ min-width: 0; }
.auth-row__right{ flex:0 0 auto; }
.auth-subhint{
  margin-top: -6px;
  font-size: 12px;
  color: var(--muted);
}

.auth-linkbtn{
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  color: var(--ui-accent);
  font-weight: 900;
  font-size: 12px;
  border-radius: 999px;
  padding: 8px 10px;
  cursor:pointer;
}
.auth-linkbtn:hover{
  border-color: rgba(37,72,168,.24);
  background: rgba(37,72,168,.08);
}
.auth-linkbtn:disabled{
  opacity:.55;
  cursor:not-allowed;
}

.auth-otp{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}
.auth-otp__cell{
  width: 100%;
  min-width: 0;          /* критично, чтобы не ломало сетку */
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--ui-border);
  font-size: 20px;
  font-weight: 900;
  text-align:center;
  outline:none;
  box-sizing:border-box;
}
.auth-otp__cell:focus{
  border-color: rgba(37,72,168,.34);
  box-shadow: var(--ui-focus-ring);
}

.auth-otp__meta{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-top: 10px;
}
.auth-otp__timer{
  flex:0 0 auto;
  font-size: 12px;
  font-weight: 900;
  color: var(--ui-muted-strong);
  white-space:nowrap;
}
.auth-otp__help{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* Buttons */
.auth-actions{
  display:flex;
  gap: 10px;
  margin-top: 12px;
}
.auth-btn{
  flex: 1 1 auto;
  height: 46px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  text-decoration:none;
  border: 1px solid transparent;
  cursor:pointer;
  user-select:none;
}


/* Mobile tweaks */
@media (max-width: 420px){
  .auth-otp{ gap: 6px; }
  .auth-otp__cell{
    height: 44px;
    font-size: 18px;
    border-radius: 10px;
  }
  .auth-head__title{ font-size: 17px; }
  .auth-actions{ flex-direction: column; }
}

.auth-row__right--actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap: wrap;
  justify-content:flex-end;
}

@media (max-width: 420px){
  .auth-row{
    flex-direction: column;
    align-items: stretch;
  }
  .auth-row__right--actions{
    justify-content:flex-start;
  }
}