/* ========================================
   VISION-SMS - Login Stylesheet
   (Identical to VISION_MX login design)
   ======================================== */

/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Pretendard', 'Noto Sans KR', 'Roboto', 'Segoe UI', sans-serif;
  height: 100vh;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
}

/* ===== Background ===== */
.login-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(19, 53, 91, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(25, 88, 160, 0.05) 0%, transparent 60%),
    #f7f9fb;
}

/* ===== Card Container ===== */
.login-card {
  width: 100%;
  max-width: 22rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow:
    0 4px 24px rgba(19, 53, 91, 0.10),
    0 1px 4px rgba(0, 0, 0, 0.06);
  animation: cardIn 0.5s ease-out;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Header Bar ===== */
.login-header {
  background-color: #13355b;
  padding: 0.875rem 1.5rem;
  text-align: center;
}

.login-header-text {
  font-family: 'Outfit', 'Pretendard', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.06em;
}

/* ===== Card Body ===== */
.login-body {
  background-color: #ffffff;
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}

/* ===== Logo ===== */
.login-logo {
  margin-bottom: 1.75rem;
}

.login-logo-text {
  font-family: 'Outfit', 'Pretendard', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #13355b;
  letter-spacing: 0.06em;
  margin: 0;
}

/* ===== Input Groups ===== */
.input-group {
  position: relative;
  margin-bottom: 0.75rem;
}

.input-group:last-of-type {
  margin-bottom: 0;
}

.input-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa5b4;
  font-size: 0.8125rem;
  pointer-events: none;
  transition: color 0.15s ease;
  z-index: 1;
}

.input-group:focus-within .input-icon {
  color: #13355b;
}

.login-form input[type="text"],
.login-form input[type="password"],
.login-form input[type="email"],
.login-form input[type="date"],
.login-form select {
  width: 100%;
  padding: 0.75rem 0.875rem 0.75rem 2.5rem;
  border: 1px solid #dde1e7;
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: #333;
  background: #f7f9fb;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

/* Fields without icons */
.input-group.no-icon input,
.input-group.no-icon select {
  padding-left: 0.875rem;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus,
.login-form input[type="email"]:focus,
.login-form input[type="date"]:focus,
.login-form select:focus {
  border-color: #13355b;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(19, 53, 91, 0.22);
}

.login-form input[type="text"]::placeholder,
.login-form input[type="password"]::placeholder,
.login-form input[type="email"]::placeholder {
  color: #9aa5b4;
  font-weight: 400;
}

/* ===== Labels ===== */
.input-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #5a6a7a;
  margin-bottom: 0.375rem;
  text-align: left;
}

/* ===== Login Button ===== */
.login-form button[type="submit"],
.login-button {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background-color: #13355b;
  color: #ffffff;
  border: none;
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.login-form button[type="submit"]:hover,
.login-button:hover {
  background-color: #0f2c4a;
  box-shadow: 0 4px 12px rgba(19, 53, 91, 0.2);
}

.login-form button[type="submit"]:active,
.login-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.login-form button[type="submit"]:focus-visible,
.login-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(19, 53, 91, 0.22);
}

.login-form button[type="submit"]:disabled,
.login-button:disabled {
  background: #adb5bd;
  cursor: not-allowed;
  box-shadow: none;
}

.login-form button i {
  font-size: 0.875rem;
}

/* ===== Links ===== */
.login-links {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #5a6a7a;
  text-decoration: none;
  transition: color 0.15s ease;
}

.login-links a:hover {
  color: #13355b;
  text-decoration: underline;
}

.link-divider {
  font-size: 0.75rem;
  color: #c0c8d6;
}

/* ===== Copyright ===== */
.login-copyright {
  margin-top: 1.25rem;
  margin-bottom: 0;
  font-size: 0.75rem;
  color: #9aa5b4;
  letter-spacing: 0.01em;
}

/* ===== Message Area =====
   메시지 없어도 항상 공간 확보 — 메시지 등장 시 form 전체 높이 변동 방지 */
.message-area {
  margin-bottom: 0.75rem;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: pre-line;
  line-height: 1.5;
  min-height: 2.5rem;          /* 메시지 1줄 + padding 분량 미리 확보 */
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.message-area:not(:empty) {
  padding: 0.625rem 0.875rem;
}

.message-area.error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.message-area.success {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

/* 모든 폼: 메시지를 입력란 위로 올렸으므로, 비어 있을 땐 공간을 잡지 않음
   (타이틀/설명과 입력란 사이 빈 간격 방지). 메시지가 뜰 때만 영역이 펼쳐진다. */
.message-area:empty {
  margin: 0;
  min-height: 0;
}

/* ===== Hidden class ===== */
.hidden {
  display: none !important;
}

/* ===== Caps Lock Warning =====
   input-group 안에 있어도 layout 영향 없도록 absolute positioning.
   → 자물쇠 아이콘(.input-icon) 의 top:50% 가 group 높이 변화에 흔들리지 않음 */
.caps-lock-warning {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 0.75rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #92400e;
  z-index: 5;
  pointer-events: none;
  animation: capsWarn 0.2s ease-out;
}

.caps-lock-warning.hidden {
  display: none !important;
}

.caps-lock-icon {
  font-style: normal;
  font-size: 0.875rem;
}

@keyframes capsWarn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Form Title (sub-forms) ===== */
.form-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #13355b;
  margin-bottom: 0.375rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-title::before {
  content: '';
  width: 3px;
  height: 18px;
  background: #13355b;
  border-radius: 2px;
}

.form-desc {
  font-size: 0.8125rem;
  color: #5a6a7a;
  margin-bottom: 1.25rem;
  line-height: 1.6;
  text-align: left;
  padding-left: 11px;
}

/* ===== Found Emails List ===== */
.found-emails {
  background: #f7f9fb;
  border: 1px solid #dde1e7;
  border-radius: 0.375rem;
  padding: 0.875rem;
  margin-bottom: 0.75rem;
  text-align: left;
}

.found-emails h4 {
  font-size: 0.8125rem;
  color: #5a6a7a;
  margin-bottom: 0.625rem;
  font-weight: 600;
}

.found-emails ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.found-emails li {
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #333;
  transition: background 0.15s;
}

.found-emails li:hover {
  background: #e8edf3;
}

.found-emails code {
  background: #13355b;
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.8125rem;
}

/* ===== Loading Animation ===== */
.login-button.loading {
  pointer-events: none;
  position: relative;
  color: transparent;
}

.login-button.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Password Setup Notice Modal ===== */
.pwd-notice-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.pwd-notice-overlay.hidden {
  display: none !important;
}

.pwd-notice-box {
  background: #ffffff;
  border-radius: 0.5rem;
  border: 1px solid #dde1e7;
  padding: 2rem 2.25rem;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 24px rgba(19, 53, 91, 0.15);
  animation: pwdNoticeIn 0.2s ease-out;
}

@keyframes pwdNoticeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.pwd-notice-icon {
  font-size: 2.5rem;
  color: #13355b;
  margin-bottom: 1rem;
  line-height: 1;
}

.pwd-notice-msg {
  font-size: 0.9375rem;
  color: #333;
  line-height: 1.7;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.pwd-notice-msg-en {
  font-size: 0.8125rem;
  color: #9aa5b4;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.pwd-notice-btn {
  padding: 0.625rem 2.75rem;
  background: #13355b;
  color: #ffffff;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.pwd-notice-btn:hover {
  background: #0f2c4a;
}

/* ===== Screen Reader Only ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 480px) {
  html {
    height: 100%;
    overflow: hidden;
  }

  body {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .login-card {
    max-width: min(18rem, 90vw);
  }

  .login-header {
    padding: 0.75rem 1.25rem;
  }

  .login-header-text {
    font-size: 1rem;
  }

  .login-body {
    padding: 1.5rem 1.5rem 1.25rem;
  }

  .login-logo {
    margin-bottom: 1.25rem;
  }

  .login-logo-text {
    font-size: 1.5rem;
  }

  .login-form input[type="text"],
  .login-form input[type="password"],
  .login-form input[type="email"],
  .login-form input[type="date"],
  .login-form select {
    padding: 0.625rem 0.75rem 0.625rem 2.25rem;
    font-size: 0.875rem;
  }

  .input-group.no-icon input,
  .input-group.no-icon select {
    padding-left: 0.75rem;
  }

  .input-icon {
    left: 0.75rem;
    font-size: 0.75rem;
  }

  .login-form button[type="submit"],
  .login-button {
    font-size: 0.875rem;
    padding: 0.625rem 0.875rem;
    margin-top: 1rem;
  }

  .login-links {
    margin-top: 1.25rem;
  }

  .login-links a {
    font-size: 0.75rem;
  }

  .login-copyright {
    margin-top: 1rem;
    font-size: 0.6875rem;
  }
}
