:root{
  --bg: #f4f5f7;
  --white: #ffffff;
  --black: #0a0a0a;
  --gray1: #f4f5f7;
  --gray2: #e8e9ed;
  --gray3: #9ca3af;
  --gray4: #6b7280;

  --violet: #7c3aed;
  --violet-light: #ede9fe;
  --green: #22c55e;
  --red: #ef4444;

  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;

  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tg-safe-b: var(--tg-viewport-stable-height, var(--safe-b));
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  height:100%;
  margin:0;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
}

.wrap{
  width:100%;
  max-width: 430px;
  margin: 0 auto;
  min-height: 100%;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 12px);
  display:flex;
  flex-direction:column;
  gap: 18px;
}

@media(max-width:560px){
  .wrap{padding: 16px 14px calc(var(--nav-h) + var(--safe-b) + 12px); gap: 14px}
}

.left .brand{
  background: var(--black);
  border-radius: var(--radius);
  padding: 24px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:flex-start;
  gap: 0;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  position: relative;
}

.brand:before{
  /* Убираем декоративный blur, чтобы не спорить с айдентикой resilix.pro */
  content:none;
}

.brand > *{position:relative}

.brandTop{
  display:flex;
  gap:14px;
  align-items:center;
  margin-bottom:16px;
}

.brandBadge{
  width:48px;
  height:48px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background: var(--white);
  color: var(--violet);
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-title{
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size:26px;
  font-weight:400;
  letter-spacing:-.3px;
  line-height:1.1;
  margin:0;
  color:#fff;
}

.brand-sub{
  color:rgba(255,255,255,.50);
  line-height:1.5;
  font-size:13px;
  font-weight:600;
  margin-top:6px;
  letter-spacing:.2px;
}

.brandMeta{position:relative}

.muted{color:var(--gray4); font-size:13px; line-height:1.5}
.chips{display:flex; flex-wrap:wrap; gap:10px; margin-top:12px}
.chip{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  color:rgba(255,255,255,.90);
}
.footer{
  margin-top:18px;
  color:rgba(255,255,255,.55);
  font-size:12px;
  line-height:1.45;
}

.card{
  padding:24px;
  border-radius: var(--radius);
  background: var(--white);
  border: 2px solid var(--gray2);
}

.cardHead{
  margin-bottom:8px;
}

h2{
  margin:0;
  font-family: 'Coolvetica', 'Montserrat', system-ui, sans-serif;
  font-size:22px;
  font-weight:400;
  letter-spacing:-.25px;
}
.sub{
  margin:8px 0 0 0;
  color: var(--gray4);
  font-size:13px;
  line-height:1.5;
}

.hr{height:1px; background: var(--gray2); margin:18px 0}
.stack{display:flex; flex-direction:column; gap:12px}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

label{
  font-size:13px;
  color: var(--gray4);
  font-weight: 600;
  letter-spacing: .1px;
}

input{
  width:100%;
  height:52px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border:2px solid var(--gray2);
  background: var(--white);
  color: var(--black);
  outline:none;
  transition: border-color .15s;
  /* Чтобы даже при autofill шрифт не “скакал” на системный. */
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-size:17px;
  font-weight:700;
  letter-spacing: 1.5px;
  text-transform: none;
}

input::placeholder{
  color: rgba(107,114,128,.55);
}

/* Chrome/Chromium password managers применяют свои стили autofill. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{
  -webkit-text-fill-color: var(--black);
  -webkit-box-shadow: 0 0 0 1000px var(--white) inset;
  transition: background-color 99999s ease-in-out 0s;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: none;
}

input:focus{
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

.alert{
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,110,110,.35);
  padding:12px 14px;
  background: rgba(255,110,110,.12);
  color: rgb(255 110 110);
  font-weight:800;
  font-size:13px;
  letter-spacing:.1px;
  margin-bottom: 12px;
}

.actions{
  display:flex;
  gap:12px;
  margin-top:16px;
  flex-wrap:wrap;
}

.actions .btn-block{width:100%}

.btn{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:44px;
  padding:0 18px;
  border-radius:999px;
  border: none;
  background: none;
  color: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  cursor:pointer;
  transition: transform .08s ease, box-shadow .15s ease;
}

.btn:hover{
  transform: none;
}

.btn:active{transform: translateY(1px)}

.btn-primary{
  background: var(--violet);
  color: #fff;
  box-shadow: 0 6px 20px rgba(124,58,237,.28);
}
.btn-primary:hover{
  box-shadow: 0 6px 20px rgba(124,58,237,.28);
}

.btn-ghost{
  border: 2px solid var(--gray2);
  background: var(--white);
  color: var(--black);
}

.btn-danger{
  background: linear-gradient(180deg, rgba(239,68,68,.25), rgba(239,68,68,.10));
}

.btn-block{width:100%}

.google-btn{
  gap: 12px;
}

.google-icon{
  width:20px;
  height:20px;
  display:block;
  flex-shrink: 0;
}

/* Когда форма активна, она переключается на flex в JS.
   Отключаем дополнительный margin-top у `.actions`, чтобы CTA
   выглядели ровнее и не “прилипали” друг к другу. */
.stack > .actions{ margin-top: 0; }

.forgot-row{
  margin-top: 2px;
  display:flex;
  justify-content:flex-end;
}

.forgot-btn{
  border:none;
  background:none;
  padding:0;
  cursor:pointer;
  color: var(--violet);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1px;
  text-decoration: underline;
}

.forgot-btn:hover{
  opacity: .9;
}

.delete-btn{
  border:none;
  background:none;
  padding:0;
  cursor:pointer;
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1px;
  text-decoration: underline;
}

.delete-btn:hover{
  opacity: .9;
}

.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}

.modal-overlay.show{
  opacity: 1;
  pointer-events: auto;
}

.modal-card{
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border-radius: var(--radius);
  border: 2px solid var(--gray2);
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  padding: 18px;
}

.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 10px;
}

.modal-title{
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .1px;
}

.modal-close{
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--black);
}

.modal-body{
  margin-bottom: 10px;
}

.modal-error{
  margin-top: 8px;
  color: #b00020;
  font-size: 12px;
  font-weight: 700;
  display: none;
}

.modal-error.show{
  display: block;
}

.modal-actions{
  display:flex;
  gap: 12px;
}

.switch-row{
  margin-top: 14px;
  text-align: center;
  color: var(--gray4);
  font-size: 13px;
  font-weight: 600;
}

.switch-row__row{
  display:flex;
  justify-content:center;
  align-items: baseline;
  gap: 8px;
}

.switch-row__btn{
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--violet);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1px;
}

.switch-row__btn:hover{
  text-decoration: underline;
}

@media(max-width:560px){
  .card,.left .brand{padding:18px}
  input{height:52px}
}
