/* 
 * JumClass Student Design System - Login Page
 * 학생용 로그인 페이지 스타일
 */

@import url('../variables.css');
@import url('../base.css');
@import url('../components/form.css');

/* ===== 초기 로딩 중 깜빡임 방지 ===== */
body.login-loading {
  visibility: hidden;
}

/* ===== Utility Classes ===== */
.hidden {
  display: none !important;
}

/* ===== Hide Default Layout Elements ===== */
body:has(.student-new .login-page) #wrapper:not(.student-new),
body:has(.student-new .login-page) .wrapper:not(.student-new),
body:has(.student-new .login-page) #header:not(.student-header),
body:has(.student-new .login-page) #footer:not(.student-footer),
body:has(.student-new .login-page) .header:not(.student-header),
body:has(.student-new .login-page) .footer:not(.student-footer),
body:has(.student-new .login-page) #gnb,
body:has(.student-new .login-page) .gnb {
  display: none !important;
}

/* ===== Login Page Background ===== */
.student-new .login-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-black);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  z-index: 99999; /* 최상위 레이어 */
}

/* Dim Layer */
.student-new .login-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ===== Login Container ===== */
.student-new .login-container {
  position: relative;
  width: 448px;
  min-height: 521px;
  padding: 44px 40px 44px; /* Reduced bottom padding since social buttons removed */
  background-color: #191919;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* ===== Logo Section ===== */
.student-new .login-logo {
  width: 100%;
  text-align: center;
  margin-bottom: 44px;
}

.student-new .login-logo img {
  width: 244px;
  height: 47px;
  margin: 0 auto;
}

.student-new .logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none; /* Remove underline for link */
  transition: opacity 0.2s ease;
}

.student-new .logo-container:hover {
  opacity: 0.8;
}

.student-new .logo-image {
  width: 244px;
  height: 47px;
  object-fit: contain;
}

.student-new .student-badge {
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 10px;
  font-weight: 700;
  line-height: 140%;
  letter-spacing: 0.3px;
  padding: 4px 8px;
  border-radius: 6px;
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 1;
}

/* If no logo image, use text */
.student-new .login-logo h1 {
  font-size: var(--font-size-28);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  letter-spacing: var(--letter-spacing-28);
  margin: 0;
}

/* ===== Login Form ===== */
.student-new .login-form {
  width: 100%;
}

/* Kakao Login Button */
.student-new .btn-kakao-login {
  width: 100%;
  height: 48px;
  padding: 0 32px;
  background-color: var(--color-kakao);
  color: var(--color-kakao-text);
  font-family: var(--font-family);
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-16);
  line-height: 48px;
  border: none;
  border-radius: var(--radius-4);
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-8);
  text-decoration: none;
  margin-bottom: 8px;
  position: relative;
}

.student-new .btn-kakao-login:hover {
  background-color: #F7D800;
  transform: translateY(-1px);
}

.student-new .btn-kakao-login svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 네이버 로그인 버튼 - 카카오 버튼과 동일한 스타일 */
.student-new .btn-naver-login {
  width: 100%;
  height: 48px;
  padding: 0 32px;
  background-color: #03C75A;
  color: #ffffff !important; /* 색상 강제 고정 */
  font-family: var(--font-family);
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-16);
  line-height: 48px;
  border: none;
  border-radius: var(--radius-4);
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-8);
  text-decoration: none;
  margin-bottom: 8px;
  position: relative;
}

.student-new .btn-naver-login:hover {
  background-color: #02A94A;
  transform: translateY(-1px);
  color: #ffffff !important; /* 호버 시에도 흰색 유지 */
}

.student-new .btn-naver-login svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 구글 로그인 버튼 - 다른 버튼들과 동일한 스타일 */
.student-new .btn-google-login {
  width: 100%;
  height: 48px;
  padding: 0 32px;
  background-color: #ffffff;
  color: #3c4043 !important; /* 색상 강제 고정 */
  font-family: var(--font-family);
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-16);
  line-height: 48px;
  border: 1px solid #dadce0;
  border-radius: var(--radius-4);
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-8);
  text-decoration: none;
  margin-bottom: 32px;
  position: relative;
}

.student-new .btn-google-login:hover {
  background-color: #f8f9fa;
  border-color: #dadce0;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,.30), 0 1px 3px 1px rgba(60,64,67,.15);
  color: #3c4043 !important; /* 호버 시에도 원래 색상 유지 */
  transform: translateY(-1px); /* 다른 버튼과 동일한 호버 효과 */
}

.student-new .btn-google-login svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Divider */
.student-new .login-divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-gray-5);
  margin-bottom: 32px;
}

/* Input Fields */
.student-new .login-input-group {
  margin-bottom: 12px;
}

.student-new .login-input-group:last-of-type {
  margin-bottom: 24px;
}

.student-new .password-input-group {
  position: relative;
}

.student-new .password-input {
  padding-right: 48px; /* 패스워드 토글 버튼을 위한 공간 */
}

/* Password Toggle Button */
.student-new .password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.student-new .password-toggle:hover {
  color: #802FFF;
  background: rgba(128, 47, 255, 0.1);
}

.student-new .password-toggle i {
  font-size: 18px;
}

.student-new .login-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: var(--color-gray-6);
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--color-white);
  font-size: 16px;
  font-weight: 400;
  line-height: 140%;
  letter-spacing: -0.48px;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.student-new .login-input::placeholder {
  color: var(--color-gray-2);
  font-size: 16px;
  font-weight: 400;
}

.student-new .login-input:focus {
  border-color: var(--color-primary);
  background: var(--color-gray-6);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.student-new .login-input.error {
  border-color: var(--color-error);
  background: rgba(251, 91, 107, 0.1);
}

/* Login Submit Button */
.student-new .btn-login-submit {
  width: 100%;
  height: 48px;
  padding: 12px 32px;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-family: var(--font-family);
  font-size: var(--font-size-16);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-16);
  line-height: var(--line-height-default);
  border: none;
  border-radius: var(--radius-4);
  cursor: pointer;
  transition: var(--transition-base);
  margin-bottom: 16px;
}

.student-new .btn-login-submit:hover {
  background-color: var(--color-primary-light);
  transform: translateY(-1px);
}

.student-new .btn-login-submit:active {
  transform: translateY(0);
}

.student-new .btn-login-submit:disabled {
  background-color: var(--color-gray-6);
  color: var(--color-text-1);
  cursor: not-allowed;
  transform: none;
}

/* ===== Checkbox and Links ===== */
.student-new .login-checkbox-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

/* Checkbox Styles - 체크박스 커스텀 디자인 */
.student-new .login-checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.student-new .login-checkbox-wrapper label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-gray-3);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0; /* 클릭 영역 확대 */
  position: relative;
  padding-left: 24px; /* 체크박스 공간 확보 - 간격 축소 */
  user-select: none;
}

/* 커스텀 체크박스 디자인 */
.student-new .login-checkbox-wrapper label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-gray-5);
  border-radius: 4px;
  background: transparent;
  transition: all 0.3s ease;
}

/* 체크 표시 */
.student-new .login-checkbox-wrapper label::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--color-white);
  border-bottom: 2px solid var(--color-white);
  transform: translateY(-60%) rotate(-45deg);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* 체크된 상태 */
.student-new .login-checkbox-wrapper input:checked + label::before {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.student-new .login-checkbox-wrapper input:checked + label::after {
  opacity: 1;
}

/* 호버 상태 */
.student-new .login-checkbox-wrapper label:hover::before {
  border-color: var(--color-primary);
}

/* 포커스 상태 (키보드 접근성) */
.student-new .login-checkbox-wrapper input:focus-visible + label::before {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ===== Additional Links ===== */
.student-new .login-links {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-8);
}

.student-new .login-links span {
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-14);
  color: var(--color-white);
}

.student-new .login-links a {
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-regular);
  letter-spacing: var(--letter-spacing-14);
  color: var(--color-primary-light);
  text-decoration: underline;
  transition: var(--transition-base);
}

.student-new .login-links a:hover {
  color: var(--color-primary);
}

/* ===== Error Messages ===== */
.student-new .login-error {
  margin-top: var(--spacing-8);
  padding: var(--spacing-12) var(--spacing-16);
  background-color: rgba(251, 91, 107, 0.1);
  border-left: 3px solid var(--color-error);
  border-radius: var(--radius-4);
}

.student-new .login-error-text {
  font-size: var(--font-size-13);
  color: var(--color-error);
  letter-spacing: var(--letter-spacing-13);
}



/* ===== Responsive ===== */
@media (max-width: 768px) {
  /* 모바일에서 백드롭 제거 */
  .student-new .login-backdrop {
    display: none;
  }
  
  /* 모바일에서 전체 화면 */
  .student-new .login-page {
    min-height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .student-new .login-container {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 60px 24px 44px !important; /* 상단 패딩 증가 (safe area 고려) */
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    border-radius: 0 !important; /* 모서리 둥글기 제거 */
    background: #000 !important;
    box-shadow: none !important;
  }
  
  .student-new .login-logo {
    margin-bottom: 44px; /* 모바일에서도 동일한 마진 유지 */
  }
  
  .student-new .login-logo img {
    width: 244px; /* 모바일에서도 동일한 크기 유지 */
    height: 47px;
  }
  
  .student-new .logo-image {
    width: 244px; /* 모바일에서도 동일한 크기 유지 */
    height: 47px;
  }
  
  /* 모바일에서 입력 필드 높이 조정 */
  .student-new .login-input {
    height: 48px; /* 모바일에서도 동일한 높이 유지 */
    font-size: 16px;
    /* 모바일에서 더 나은 터치 경험 */
    -webkit-appearance: none;
    border-radius: 2px;
  }
  
  /* 모바일에서 로그인 버튼 높이 조정 */
  .student-new .btn-login-submit {
    height: 48px; /* 모바일에서도 동일한 높이 유지 */
    font-size: 16px;
    /* 모바일에서 더 나은 터치 경험 */
    -webkit-tap-highlight-color: transparent;
    min-height: 48px; /* 최소 터치 영역 보장 */
  }
  
  
  /* 모바일에서 링크 텍스트 크기 조정 */
  .student-new .login-links {
    font-size: 14px;
    /* 모바일에서 더 나은 터치 영역 */
    gap: 8px;
  }
  
  .student-new .login-links a {
    /* 모바일에서 더 나은 터치 영역 */
    padding: 4px 8px;
    margin: -4px -8px;
  }
  
  /* 모바일에서 포커스 상태 개선 */
  .student-new .login-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(128, 47, 255, 0.2);
  }
  
  /* 모바일에서 버튼 터치 피드백 */
  .student-new .btn-login-submit:active {
    transform: scale(0.98);
  }
}

@media (max-width: 480px) {
  .student-new .login-container {
    /* 전체 화면 유지 - margin과 padding은 768px 미디어 쿼리에서 상속 */
  }
  
  .student-new .login-logo {
    margin-bottom: 44px;
  }
  
  .student-new .login-logo img {
    width: 244px;
    height: 47px;
  }
  
  .student-new .logo-image {
    width: 244px;
    height: 47px;
  }
  
  .student-new .btn-login-submit {
    height: 48px;
    font-size: 16px;
    /* 작은 화면에서 더 나은 터치 경험 */
    min-height: 48px;
  }
  
  /* 입력 필드 높이 유지 */
  .student-new .login-input {
    height: 48px;
    font-size: 16px;
  }
  
  /* 작은 화면에서 더 나은 간격 */
  .student-new .login-input-group {
    margin-bottom: 16px;
  }
  
  .student-new .login-checkbox-wrapper {
    margin-bottom: 24px;
  }
  
  /* 작은 화면에서 체크박스 레이블 패딩 추가 조정 */
  .student-new .login-checkbox-wrapper label {
    padding-left: 36px; /* 더 작은 화면에서 패딩 증가 */
  }
  

}

/* ===== Modal Styles ===== */
.login-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.login-modal.student-new {
  z-index: 999999;
}

.login-modal-content {
  position: absolute;
  width: 320px;
  left: calc(50% - 320px/2);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 32px;
  gap: 32px;
  background: #191919;
  border-radius: 20px;
  z-index: 999999;
}

.login-modal-header {
  display: none; /* 헤더는 새 디자인에서 제거 */
}

.login-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.login-modal-title.error {
  color: #FB5B6B;
}

.login-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-modal-close:hover {
  color: #666;
}

.login-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0px;
  gap: 20px;
  width: 256px;
  flex: none;
  order: 0;
  flex-grow: 0;
}

.login-modal-body p {
  width: 256px;
  font-family: 'Pretendard';
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 140%;
  text-align: center;
  letter-spacing: -0.03em;
  color: #999999;
  margin: 0;
  flex: none;
  order: 1;
  align-self: stretch;
  flex-grow: 0;
}

.login-modal-body p:last-child {
  margin-bottom: 0;
}

.login-modal-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  gap: 12px;
  width: 256px;
  height: 34px;
  flex: none;
  order: 1;
  flex-grow: 0;
}

.login-modal-btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 7px 16px;
  gap: 8px;
  width: 122px;
  height: 34px;
  background: #802FFF;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-family: 'Pretendard';
  font-style: normal;
  font-weight: 700;
  font-size: 14px;
  line-height: 140%;
  text-align: center;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  transition: all 0.2s ease;
  flex: none;
  order: 1;
  flex-grow: 0;
}

.login-modal-btn:hover {
  background: #6A25D9;
}

.login-modal-btn.secondary {
  background: #292929;
  order: 0;
}

.login-modal-btn.secondary:hover {
  background: #3A3A3A;
}

/* Modal Icon */
.login-modal-icon {
  width: 48px;
  height: 48px;
  position: relative;
  flex: none;
  order: 0;
  flex-grow: 0;
}

.login-modal-icon::before {
  content: '';
  position: absolute;
  width: 39.75px;
  height: 39.75px;
  left: calc(50% - 39.75px/2);
  top: calc(50% - 39.75px/2);
  background: #802FFF;
  border-radius: 50%;
}

.login-modal-icon::after {
  content: '!';
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-family: 'Pretendard';
  font-weight: 700;
  font-size: 24px;
  z-index: 1;
}

/* Error icon */
.login-modal-icon.error::before {
  background: #FB5B6B;
}

.login-modal-icon.error::after {
  content: '×';
  font-size: 28px;
}

.login-modal-btn:active {
  transform: scale(0.98);
}