/**
 * Login Page Styles
 * 학생 로그인 페이지 전용 CSS
 */

/* ============================================
   페이지 레이아웃
   ============================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #e0e7ff 0%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================================
   로그인 카드
   ============================================ */
.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 32px;
  max-width: 400px;
  width: 100%;
}

/* ============================================
   로고 영역
   ============================================ */
.login-logo-area {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  font-size: 48px;
  color: #4f46e5;
  margin-bottom: 12px;
  display: block;
}

.login-logo-title {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px 0;
}

.login-logo-subtitle {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

/* ============================================
   활동코드 안내문
   ============================================ */
.login-activity-code-notice {
  display: none;
  padding: 12px;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  color: #3730a3;
  font-size: 14px;
  margin-bottom: 24px;
  text-align: center;
}

.login-activity-code-notice.visible {
  display: block;
}

/* ============================================
   탭 전환 영역
   ============================================ */
.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid #e2e8f0;
}

.login-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  margin: 0 0 -2px 0;
}

.login-tab:hover {
  color: #4f46e5;
}

.login-tab.active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

/* ============================================
   탭 콘텐츠
   ============================================ */
.login-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.login-tab-content.active {
  display: block;
}

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

/* ============================================
   입력 필드 스타일
   ============================================ */
.login-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.login-input-group label {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

.login-input,
.login-select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  color: #1e293b;
  font-family: inherit;
  transition: all 0.2s ease;
}

.login-input:focus,
.login-select:focus {
  outline: none;
  background: white;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px #e0e7ff;
}

.login-input::placeholder {
  color: #94a3b8;
}

.login-input:disabled,
.login-select:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}

.login-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

/* ============================================
   2x2 그리드 (학번 입력용)
   ============================================ */
.login-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.login-grid-2x2 .login-input-group {
  margin-bottom: 0;
}

.login-grid-full {
  grid-column: 1 / -1;
}

/* ============================================
   버튼
   ============================================ */
.login-btn {
  width: 100%;
  height: 48px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.login-btn:hover {
  background: #3730a3;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

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

.login-btn:disabled {
  background: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
}

.login-btn-loading {
  position: relative;
}

.login-btn-loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   에러 메시지
   ============================================ */
.login-error {
  padding: 12px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  display: none;
}

.login-error.visible {
  display: flex;
}

.login-error i {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 16px;
}

.login-error-text {
  flex: 1;
}

/* ============================================
   성공 메시지
   ============================================ */
.login-success {
  padding: 12px;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  display: none;
}

.login-success.visible {
  display: flex;
}

.login-success i {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 16px;
}

/* ============================================
   하단 링크
   ============================================ */
.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-size: 13px;
  color: #64748b;
}

.login-footer a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ============================================
   반응형 디자인
   ============================================ */
@media (max-width: 480px) {
  .login-card {
    padding: 24px 16px;
  }

  .login-logo-icon {
    font-size: 40px;
  }

  .login-logo-title {
    font-size: 20px;
  }

  .login-grid-2x2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .login-grid-full {
    grid-column: 1;
  }

  .login-btn {
    height: 44px;
    font-size: 15px;
  }
}

/* ============================================
   스켈레톤 로딩
   ============================================ */
.login-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  height: 44px;
  border-radius: 8px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
