:root{
  --blue: #0056e0;
  --blue-dark:#0041b8;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#e5e7eb;
  --card:#ffffff;
  --bg:#f5f7fb;
  --radius: 22px;
  --btn-shadow: 0 6px 0 rgba(0,0,0,.08), 0 8px 18px rgba(0,0,0,.10);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: "Montserrat", "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  display:flex; align-items:center; justify-content:center;
  padding: 24px;
  color: var(--text);
}

.auth{
  width: 100%;
  max-width: 980px;
  min-height: 440px;
  background: var(--card);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0,0,0,.08);
  border: 1px solid #eef2f7;
}

/* Сол жақ көк панель */
.auth-aside{
  background: var(--blue);
  padding: 42px 36px;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  position: relative;
  color: #fff;
}

.auth-aside .logo{
  width: 220px; max-width: 80%;
  display:block; margin-bottom: 18px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.18));
}

.brand-text{
  text-align:center;
  font-weight:500;
  letter-spacing:.2px;
  line-height:1.35;
  font-size: 14px;
  opacity:.95;
}

/* Соц. желілер */
.social {
  display: flex;
  gap: 14px;
  margin-top: 40px;
}
.social a {
  color: #ffffff;
  background: rgba(255,255,255,0.15);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  font-size: 17px;
  transition: all 0.25s ease;
}
.social a:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* Оң жақ панель */
.auth-main{
  background: var(--card);
  padding: 42px 46px;
  display:flex; flex-direction:column; justify-content:center;
}

.title{
  font-size: 24px;
  font-weight: 700;
  color:#374151;
  margin: 6px 0 22px;
  position: relative;
  letter-spacing:.2px;
}
.title::after{
  content:""; display:block; width:46px; height:4px;
  border-radius:4px; background: var(--blue);
  margin-top:10px;
}

/* Өрістер */
.field{ margin-bottom: 20px; }
.label{
  display:block;
  margin-bottom:8px;
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 600;
}

.input{
  width:100%;
  background: transparent;
  border:none;
  border-bottom: 1px solid var(--border);
  padding: 10px 2px;
  font-size: 15px;
  outline:none;
  transition:border-color .15s ease;
  font-family: "Montserrat", sans-serif;
}
.input::placeholder{ color:#a0aec0; }
.input:focus{ border-color: var(--blue); }

/* Құпиясөз батырмасы */
.password-wrap{ position: relative; }
.toggle-pass{
  position: absolute;
  right: 0; top: 50%; transform: translateY(-50%);
  padding: 6px 10px;
  font-size: 12.5px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #374151;
  cursor: pointer;
  font-weight: 600;
  transition: .2s ease;
}
.toggle-pass:hover{ background:#e9eef6; }

/* Есте сақтау + ұмыттыңыз ба */
.row{
  display:flex; align-items:center; justify-content:space-between;
  gap: 8px; margin: 6px 0 14px; font-size: 13px; color:#555;
}
.remember-label{
  display:inline-flex; align-items:center; gap:8px;
  cursor:pointer;
}
.row a{ color: var(--blue); text-decoration: none; font-weight:600; }
.row a:hover{ text-decoration: underline; }

/* Батырма */
.btn{
  width: 220px;
  padding: 12px 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color:#fff;
  font-weight:700;
  font-size: 15px;
  border:none;
  cursor:pointer;
  box-shadow: 0 6px 14px rgba(0,86,224,.28);
  transition: transform .05s ease, filter .15s ease, box-shadow .2s ease;
  font-family: "Montserrat", sans-serif;
  letter-spacing:.2px;
}
.btn:hover{
  filter: brightness(1.05);
  box-shadow: 0 10px 20px rgba(0,86,224,.32);
}
.btn:active{
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(0,86,224,.24);
}
.btn[disabled]{ opacity:.6; cursor:not-allowed; }

.message{
  margin-top:14px;
  color:#dc2626;
  font-size:14px;
  min-height:18px;
  font-weight:600;
}

footer{
  text-align:center;
  margin-top:18px;
  color:#94a3b8;
  font-size:12.5px;
  font-weight:600;
}

/* Мобиль */
@media (max-width:900px){
  .auth{ grid-template-columns:1fr; max-width:520px; }
  .auth-aside{ padding:36px 24px; }
  .auth-main{ padding:32px 24px; }
  .btn{ width:100%; }
}

/* Responsive and cross-browser stability */
html{
  -webkit-text-size-adjust:100%;
}
button,
input{
  font:inherit;
}
img{
  max-width:100%;
  height:auto;
}
body{
  min-height:100vh;
  min-height:100dvh;
  height:auto;
}
.auth,
.auth-main,
.auth-aside{
  min-width:0;
}

@media (max-width:560px){
  body{
    padding:0;
    align-items:flex-start;
  }
  .auth{
    min-height:100vh;
    min-height:100dvh;
    border:none;
    border-radius:0;
    box-shadow:none;
  }
  .auth-aside{
    padding:28px 20px 24px;
  }
  .auth-aside .logo{
    width:190px;
  }
  .social{
    margin-top:24px;
    flex-wrap:wrap;
    justify-content:center;
  }
  .auth-main{
    padding:28px 20px 32px;
  }
  .title{
    margin-top:0;
    font-size:22px;
    line-height:1.25;
  }
  .row{
    flex-wrap:wrap;
    align-items:flex-start;
    gap:10px 14px;
  }
  .toggle-pass{
    top:52%;
  }
  footer{
    font-size:12px;
  }
}

@media (max-height:640px) and (min-width:901px){
  body{
    align-items:flex-start;
    padding-top:16px;
    padding-bottom:16px;
  }
  .auth{
    min-height:0;
  }
  .auth-aside,
  .auth-main{
    padding-top:30px;
    padding-bottom:30px;
  }
  .social{
    margin-top:24px;
  }
}

/* Phone fit: keep the card visible inside the viewport */
@media (max-width:560px){
  body{
    padding:12px 0;
    align-items:flex-start;
    justify-content:center;
    overflow-x:hidden;
  }
  .auth{
    display:flex;
    flex-direction:column;
    width:calc(100vw - 24px) !important;
    max-width:calc(100vw - 24px) !important;
    margin:0 auto;
    min-height:auto;
    border:1px solid #eef2f7;
    border-radius:18px;
    box-shadow:0 12px 30px rgba(15,23,42,.08);
    overflow:hidden;
  }
  .auth-aside{
    width:100%;
    padding:24px 18px 22px;
  }
  .auth-main{
    width:100%;
    padding:24px 18px 28px;
  }
  .row{
    gap:10px;
  }
  .brand-text,
  .title,
  .label,
  .message,
  footer{
    max-width:100%;
    overflow-wrap:break-word;
  }
  .field,
  .password-wrap,
  .input,
  .btn{
    max-width:100%;
    min-width:0;
  }
  .input{
    font-size:16px;
  }
  .row{
    width:100%;
  }
  .row a,
  .remember-label{
    min-width:0;
    overflow-wrap:break-word;
  }
  .toggle-pass{
    max-width:96px;
  }
}
