:root {
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-50: #eff6ff;
  --gray-700: #334155;
  --gray-500: #64748b;
  --white: #ffffff;
  --error: #dc2626;
  --shadow: 0 12px 40px rgba(37, 99, 235, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.login-page {
  font-family: 'Pretendard', system-ui, -apple-system, sans-serif;
  color: var(--gray-700);
  background: var(--white);
}

/* ——— PC: 좌 50% 이미지, 우 50% 폼 ——— */
.layout {
  display: flex;
  min-height: 100vh;
  background: var(--white);
}

.layout__visual {
  flex: 0 0 50%;
  max-width: 50%;
  position: relative;
  overflow: hidden;
  background: var(--blue-50);
}

.layout__visual-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.layout__panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--white);
}

.card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.card__title {
  font-family: 'Paperlogy', sans-serif;
  font-weight: 700;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  color: #1e3a5f;
  margin: 0 0 1.25rem;
  line-height: 1.35;
}

.card__logo {
  display: block;
  margin: 0 auto 2rem;
  max-width: 200px;
  height: auto;
}

.form {
  text-align: left;
}

.field {
  display: block;
  margin-bottom: 1.1rem;
}

.field__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}

.field__input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: var(--white);
  color: var(--gray-700);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field__input:hover {
  border-color: #cbd5e1;
}

.field__input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: filter 0.15s, transform 0.1s;
}

.btn:hover {
  filter: brightness(1.05);
}

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

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ——— 모바일: 배경 이미지 + 중앙 카드 ——— */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--blue-50) url('/login-bg.webp') center / cover no-repeat fixed;
  }

  .layout__visual {
    display: none;
  }

  .layout__panel {
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: transparent;
  }

  .card {
    max-width: 100%;
    padding: 1.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(30, 58, 95, 0.12);
    backdrop-filter: blur(8px);
  }

  .card__title {
    font-size: 1.4rem;
  }
}

/* ——— 모달 ——— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal.is-open .modal__panel {
  transform: translateY(0) scale(1);
}

body.modal-open {
  overflow: hidden;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 2rem 1.75rem 1.5rem;
  background: var(--white);
  border-radius: 18px;
  box-shadow:
    0 4px 6px -1px rgba(30, 58, 95, 0.06),
    0 24px 48px -12px rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(226, 232, 240, 0.9);
  text-align: center;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal__icon-wrap {
  margin-bottom: 1rem;
}

.modal__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto;
}

.modal__icon--success {
  color: var(--blue-600);
  background: linear-gradient(145deg, var(--blue-50), #dbeafe);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal__icon--error {
  color: var(--error);
  background: linear-gradient(145deg, #fef2f2, #fee2e2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.modal__icon[hidden] {
  display: none;
}

.modal__svg {
  width: 40px;
  height: 40px;
}

.modal__title {
  font-family: 'Paperlogy', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #1e3a5f;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.modal__desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--gray-500);
  margin: 0 0 1.5rem;
}

.modal__btn {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(180deg, var(--blue-500), var(--blue-600));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: filter 0.15s, transform 0.1s;
}

.modal__btn:hover {
  filter: brightness(1.05);
}

.modal__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

.modal__btn:active {
  transform: translateY(1px);
}

.modal--error .modal__panel {
  border-color: rgba(252, 165, 165, 0.35);
}

.modal--success .modal__panel {
  border-color: rgba(147, 197, 253, 0.45);
}

.login-loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.login-loading[hidden] {
  display: none;
}

.login-loading__panel {
  width: min(440px, calc(100% - 2rem));
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem 1rem 0.9rem;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.login-loading__text {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  color: #334155;
}

.login-loading__bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.login-loading__bar-fill {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-600));
  animation: login-loading-slide 1.1s ease-in-out infinite;
}

@keyframes login-loading-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}
