/* ============ Mil Suertes landing ============ */

:root{
  --bg:        #0a0b0a;
  --panel:     #101110;
  --field:     #1b1c1d;
  --field-brd: #2a2b2c;
  --text:      #ffffff;
  --muted:     #8f9296;
  --muted-2:   #6f7378;
  --green:     #3fa25a;
  --green-hi:  #4dbb6d;
  --green-btn: #2f8f52;
  --danger:    #e05555;
  --radius:    14px;
  --font:      'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*{ margin:0; padding:0; box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  min-height:100dvh;
}
img,svg{ display:block; }
[hidden]{ display:none !important; }
a{ color:inherit; text-decoration:none; }
button{ font:inherit; color:inherit; background:none; border:0; cursor:pointer; }
input{ font:inherit; color:inherit; background:none; border:0; outline:none; width:100%; }
input::placeholder{ color:var(--muted); opacity:1; }

/* Автозаполнение Chrome/Safari — не даём красить поле в белый */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active{
  -webkit-text-fill-color:var(--text);
  -webkit-box-shadow:0 0 0 1000px var(--field) inset;
  box-shadow:0 0 0 1000px var(--field) inset;
  caret-color:var(--text);
  transition:background-color 99999s ease-out;
}

/* ---------- Баннер ---------- */
.banner{
  background-image:url('../assets/banner-mobile-ar.png');
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
}
html[data-geo="co"] .banner{ background-image:url('../assets/banner-mobile-co.png'); }

/* ---------- Шапка ---------- */
.site-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  position:relative; z-index:5;
}
.logo{ display:flex; align-items:center; }
.logo-img{ height:40px; width:auto; }
.btn-login{
  background:var(--green-btn); color:#fff;
  font-weight:700; font-size:14px;
  padding:11px 22px; border-radius:999px;
  transition:background .15s;
}
.btn-login:hover{ background:var(--green-hi); }

/* ---------- Панель формы ---------- */
.panel{ background:var(--bg); }

form{ display:flex; flex-direction:column; gap:12px; padding:18px 16px 24px; }

/* ---------- Поля ---------- */
.field{
  background:var(--field);
  border:1px solid transparent;
  border-radius:var(--radius);
  min-height:64px;
  transition:border-color .15s;
}
.field:focus-within{ border-color:#3a3b3c; }
.field.invalid{ border-color:var(--danger); }

.field-plain{ display:flex; align-items:center; padding:0 18px; }
.field-plain input{ height:62px; font-size:16px; }

.field-pass{ gap:10px; }
.eye{ color:var(--muted); flex:0 0 auto; padding:4px; }
.eye:hover{ color:#fff; }
.eye svg{ width:24px; height:24px; }

/* Телефон */
.phone-row{ display:flex; gap:10px; }
.dd-country{ flex:0 0 auto; }
.field-phone{
  flex:1 1 auto; display:flex; flex-direction:column; justify-content:center;
  padding:10px 18px; cursor:text;
}
.f-label{ font-size:12px; color:var(--muted); margin-bottom:4px; }
.f-row{ display:flex; align-items:center; gap:2px; }
.dial{ font-size:16px; font-weight:600; white-space:nowrap; }
.field-phone input{ font-size:16px; }

/* ---------- Дропдауны ---------- */
.dd{ position:relative; }
.dd-toggle{
  display:flex; align-items:center; gap:12px;
  width:100%; text-align:left; padding:10px 14px 10px 12px;
}
.dd-country .dd-toggle{ padding:10px 12px; gap:8px; height:64px; }
.flag{ font-size:26px; line-height:1; }
.dd-caret{ color:var(--muted); flex:0 0 auto; }
.dd-caret svg{ width:18px; height:18px; }
.dd-ico{ flex:0 0 auto; width:38px; height:38px; }
.dd-ico svg, .dd-ico img{ width:38px; height:38px; object-fit:contain; }
.dd-text{ flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:3px; }
.dd-label{
  font-size:12px; color:var(--muted);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.dd-value{
  font-size:15.5px; font-weight:700;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.dd-menu{
  position:absolute; top:calc(100% + 6px); left:0; z-index:20;
  min-width:100%; max-height:280px; overflow:auto;
  background:#1f2021; border:1px solid #313234; border-radius:12px;
  box-shadow:0 12px 32px rgba(0,0,0,.55);
  list-style:none; padding:6px; display:none;
}
.dd.open .dd-menu{ display:block; }
.dd.open .dd-toggle{ outline:1px solid #3a3b3c; border-radius:var(--radius); }
.dd-menu li{
  display:flex; align-items:center; gap:10px;
  padding:11px 12px; border-radius:9px; cursor:pointer;
  font-size:14.5px; font-weight:600; white-space:nowrap;
}
.dd-menu li:hover{ background:#2a2b2d; }
.dd-menu li.sel{ color:var(--green-hi); }
.dd-menu li .flag{ font-size:22px; }
.dd-menu li .code{ color:var(--muted); font-weight:500; }
.dd-menu li .ico{ width:28px; height:28px; }
.dd-menu li .ico svg, .dd-menu li .ico img{ width:28px; height:28px; object-fit:contain; }
.dd-menu li .two{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.dd-menu li .two small{ font-size:11.5px; color:var(--muted); font-weight:500; }

/* ---------- Чек-лист пароля ---------- */
.rules{ list-style:none; display:flex; flex-direction:column; gap:9px; padding:2px 4px; }
.rules li{
  display:flex; align-items:center; gap:10px;
  font-size:13.5px; color:var(--muted); font-weight:500;
  transition:color .15s;
}
.rules .dot{
  width:7px; height:7px; border-radius:50%;
  background:var(--muted-2); flex:0 0 auto;
  transition:background .15s;
}
.rules li.ok{ color:var(--green-hi); }
.rules li.ok .dot{ background:var(--green-hi); }

/* ---------- 18+ / условия ---------- */
.terms{
  display:flex; align-items:center; gap:14px;
  padding:18px; margin-top:4px;
}
.terms-text{ flex:1 1 auto; font-size:15px; line-height:1.45; font-weight:500; }
.terms-text a{ color:var(--green); }
.terms-text a:hover{ color:var(--green-hi); }
.check{ position:relative; flex:0 0 auto; cursor:pointer; }
.check input{ position:absolute; inset:0; opacity:0; cursor:pointer; }
.check-box{
  width:24px; height:24px; border-radius:7px;
  background:#3a3d3f; display:flex; align-items:center; justify-content:center;
  transition:background .15s;
}
.check-box svg{ width:15px; height:15px; opacity:0; transition:opacity .1s; }
.check input:checked + .check-box{ background:var(--green); }
.check input:checked + .check-box svg{ opacity:1; }

/* ---------- Кнопка ---------- */
.btn-primary{
  position:relative;
  min-height:64px; border-radius:var(--radius);
  background:var(--field); color:var(--muted);
  font-size:16.5px; font-weight:700;
  margin-top:10px;
  transition:background .15s, color .15s;
}
.btn-primary:not(:disabled){ background:var(--green-btn); color:#fff; }
.btn-primary:not(:disabled):hover{ background:var(--green-hi); }
.btn-primary:disabled{ cursor:default; }
.btn-primary.loading .btn-text{ visibility:hidden; }
.spinner{
  position:absolute; inset:0; margin:auto;
  width:24px; height:24px;
  border:3px solid rgba(255,255,255,.25); border-top-color:#fff;
  border-radius:50%;
  animation:spin .7s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.form-error{
  text-align:center; font-size:14px; font-weight:600;
  color:var(--danger); line-height:1.45; margin-top:2px;
}

.alt{ text-align:center; font-size:16.5px; font-weight:700; margin-top:14px; }
.alt a{ color:var(--green); }
.alt a:hover{ color:var(--green-hi); }

/* ---------- Успех ---------- */
.success{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  gap:16px; padding:56px 24px 64px;
}
.success-ico{
  width:74px; height:74px; border-radius:50%;
  background:var(--green); display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 0 10px rgba(63,162,90,.15);
}
.success-ico svg{ width:38px; height:38px; }
.success h2{ font-size:22px; font-weight:800; }
.success p{ color:var(--muted); font-size:15px; line-height:1.5; }
.redirecting{
  display:flex; align-items:center; gap:12px;
  margin-top:10px; color:var(--text);
  font-size:15px; font-weight:600;
}
.redirecting .spinner{
  position:static; inset:auto; margin:0;
  width:20px; height:20px;
  border-width:2.5px;
  border-color:rgba(255,255,255,.2);
  border-top-color:var(--green-hi);
}

/* ============ Мобайл (по умолчанию) ============ */
.banner{ width:100%; aspect-ratio:720/405; }
.layout{ display:block; }
.panel{ max-width:560px; margin:0 auto; }

/* ============ Десктоп ============ */
@media (min-width: 960px){
  .banner{
    position:fixed; inset:0; z-index:0; aspect-ratio:auto;
    background-image:url('../assets/banner-desktop-ar.png');
    background-position:40% center;
  }
  html[data-geo="co"] .banner{ background-image:url('../assets/banner-desktop-co.png'); }

  .site-header{
    position:absolute; top:0; left:0; right:0; z-index:10;
    padding:26px 40px;
  }
  .logo-img{ height:48px; }
  .btn-login{ font-size:15px; padding:13px 26px; }

  .layout{
    position:relative; z-index:5;
    min-height:100vh;
    display:flex; align-items:center; justify-content:flex-end;
    padding:96px 5vw 40px;
  }
  .panel{
    width:430px; max-width:430px; margin:0;
    background:var(--panel);
    border-radius:16px;
    box-shadow:0 18px 50px rgba(0,0,0,.6);
    max-height:min(88vh, 860px);
    overflow:auto;
    scrollbar-width:none;
  }
  .panel::-webkit-scrollbar{ display:none; }
  form{ padding:24px 22px 26px; }
}
