/* Login page — builds on styles.css */

.login { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* Left photo panel */
.login-media { position: relative; overflow: hidden; background: #cfd8c6; }
.login-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 45% 60%; }
.login-media::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 30%; z-index: 1;
  background: linear-gradient(rgba(243, 241, 236, .94), rgba(243, 241, 236, .86) 50%, rgba(243, 241, 236, 0));
}
.login-brand { position: absolute; top: 40px; left: 56px; z-index: 2; display: grid; gap: 6px; }
.login-brand small { font-size: 14px; color: var(--ink-2); }

/* Right panel */
.login-panel {
  position: relative; overflow: hidden; display: grid; place-items: center; padding: 48px 24px;
}
.login-panel::before, .login-panel::after {
  content: ""; position: absolute; border: 1px solid #e6e2d9; border-radius: 50%; pointer-events: none;
}
.login-panel::before { width: 900px; height: 900px; top: -560px; right: -520px; }
.login-panel::after { width: 700px; height: 700px; bottom: -520px; right: -300px; }

.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 480px;
  padding: 48px 48px 40px; background: #fff; border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(17, 22, 20, .04), 0 16px 48px rgba(17, 22, 20, .06);
}
.welcome { margin: 0 0 4px; font-size: 20px; color: var(--ink-2); }
.login-logo { display: inline-block; font-size: 46px; line-height: 1.1; }
.brand-line { margin: 8px 0 40px; font-size: 14px; }

.login-form h1 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.02em; }
.login-form .sub { margin: 0 0 28px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.login-form label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }

.phone-field {
  display: flex; margin-bottom: 20px; background: #f8f7f3; border: 1px solid var(--field-border); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.phone-field:focus-within { background: #fff; border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 1px; box-shadow: 0 0 0 3px rgba(17, 22, 20, .08); }
.cc { position: relative; border-right: 1px solid var(--field-border); }
.cc::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 6px; height: 6px; pointer-events: none;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); transform: translateY(-70%) rotate(45deg);
}
.cc select {
  appearance: none; -webkit-appearance: none; height: 100%; padding: 0 34px 0 14px;
  font: inherit; font-size: 16px; color: var(--ink); background: transparent; border: 0; cursor: pointer;
}
.cc select:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 4px; }
.phone-field input, .otp-input {
  flex: 1; min-width: 0; padding: 14px 16px; font: inherit; font-size: 16px; color: var(--ink);
  background: transparent; border: 0;
}
.phone-field input { width: 0; }
.phone-field input:focus { outline: none; }
.phone-field:has([aria-invalid="true"]) { border-color: #b4243f; border-width: 2px; }
.otp-input {
  width: 100%; margin-bottom: 20px; letter-spacing: .5em; font-size: 20px; font-weight: 600;
  background: #f8f7f3; border: 1px solid var(--field-border); border-radius: 10px;
}
.otp-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; background: #fff; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 22, 20, .08); }
.login ::placeholder { color: #6b706d; opacity: 1; letter-spacing: normal; font-weight: 400; }

.btn-block { width: 100%; justify-content: center; padding: 15px 22px; font: inherit; font-size: 16px; font-weight: 600; border: 0; cursor: pointer; border-radius: 12px; }
.btn-block:disabled { opacity: .6; cursor: progress; transform: none; }
.hint { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--ink-2); }
.link-btn { padding: 0; font: inherit; font-weight: 600; color: var(--ink); background: none; border: 0; text-decoration: underline; cursor: pointer; }

.form-msg { margin: 12px 0 0; padding: 10px 12px; font-size: 14px; border-radius: 8px; }
.form-msg:empty { padding: 0; margin: 0; }
.form-msg.err { background: #fde8ec; color: #a3203f; }
.form-msg.ok { background: var(--green-bg); color: #1b6b33; }

.or { display: flex; align-items: center; gap: 16px; margin: 40px 0 16px; font-size: 14px; color: var(--ink-2); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.learn { display: block; text-align: center; font-weight: 500; }

@media (max-width: 960px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-media { min-height: 260px; }
  .login-media::before { height: 70%; }
  .login-brand { top: 24px; left: 24px; }
  .login-panel { z-index: 2; margin-top: -48px; padding: 0 16px 40px; place-items: start center; }
  .login-card { padding: 32px 24px; }
  .login-logo { font-size: 38px; }
  .brand-line { margin-bottom: 28px; }
}
