/* 인증 관련 스타일 */

/* 로그인 오버레이 */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
      135deg,
      rgba(102, 126, 234, 0.6) 0%,
      rgba(249, 244, 255, 0.6) 100%
    ),
    url("../images/login-bg.jpg") center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 450px;
  animation: slideUp 0.5s ease;
}

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

.login-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.login-header {
  padding: 1.5rem 2rem 1rem;
  text-align: center;
  background: linear-gradient(45deg, #f8fafc, #e2e8f0);
}

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

.logo-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.logo-image {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1e293b;
  margin: 0;
}

.login-subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin: 0;
}

.login-content {
  padding: 1.25rem 2rem 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.form-input {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
}

.password-input-wrapper {
  position: relative;
  width: 100%;
}

.password-input-wrapper .password-input {
  width: 100%;
  padding-right: 3rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.password-toggle-btn:hover {
  color: #374151;
}

.password-toggle-btn:focus {
  outline: none;
  color: #2563eb;
}

.login-info {
  margin-bottom: 2rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #475569;
}

.info-icon {
  font-size: 1.2rem;
}

.login-actions {
  margin-bottom: 1rem;
}

.web-login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}

.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-large {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 10px;
}

.btn-icon {
  font-size: 1.2rem;
}

.login-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #f1f5f9;
  border-radius: 8px;
  color: #475569;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.success-icon,
.error-icon {
  font-size: 1.2rem;
}

.login-help {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

.help-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.help-link:hover {
  text-decoration: underline;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
}

/* 도움말 모달 */
.help-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 2rem;
}

.help-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.help-modal-header h3 {
  margin: 0;
  color: #1e293b;
}

.help-modal-body {
  padding: 1.5rem;
}

.help-section {
  margin-bottom: 1.5rem;
}

.help-section h4 {
  color: #1e293b;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.help-section p {
  color: #64748b;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.help-section ul {
  color: #64748b;
  padding-left: 1.5rem;
}

.help-section li {
  margin-bottom: 0.25rem;
}

/* 사용자 프로필 */
.user-profile {
  position: relative;
}

.profile-dropdown {
  position: relative;
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.profile-trigger:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-name {
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-arrow {
  font-size: 0.75rem;
  color: #94a3b8;
  transition: transform 0.3s;
}

.profile-dropdown.active .profile-arrow {
  transform: rotate(180deg);
}

.profile-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 280px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s;
}

.profile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
}

.profile-avatar-large .avatar-text {
  font-size: 1rem;
}

.profile-details {
  flex: 1;
  min-width: 0;
}

.profile-details .profile-name {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.profile-email {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.profile-dept {
  font-size: 0.75rem;
  color: #94a3b8;
}

.admin-badge {
  display: inline-block;
  background: #dc2626;
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.profile-menu-items {
  padding: 0.5rem;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
  transition: background-color 0.2s;
  text-align: left;
}

.menu-item:hover {
  background: #f3f4f6;
}

.logout-item:hover {
  background: #fee2e2;
  color: #dc2626;
}

.menu-icon {
  font-size: 1rem;
}

.menu-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 0.5rem 0;
}

/* 프로필 모달 */
.profile-modal .modal-content {
  max-width: 600px;
}

.profile-modal-content {
  display: grid;
  gap: 2rem;
}

.profile-avatar-section {
  text-align: center;
}

.profile-avatar-xl {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  margin: 0 auto 1rem;
}

.profile-avatar-xl .avatar-text {
  font-size: 2rem;
}

.admin-badge-large {
  display: inline-block;
  background: #dc2626;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.profile-info-section {
  display: grid;
  gap: 1.5rem;
}

.info-group {
  display: grid;
  gap: 0.5rem;
}

.info-group label {
  font-weight: 600;
  color: #374151;
  font-size: 0.875rem;
}

.info-value {
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  color: #1f2937;
}

.profile-stats-section h4 {
  margin-bottom: 1rem;
  color: #1f2937;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2563eb;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
}

/* 설정 모달 */
.settings-modal .modal-content {
  max-width: 500px;
}

.settings-form {
  display: grid;
  gap: 2rem;
}

.settings-section h4 {
  margin-bottom: 1rem;
  color: #1f2937;
  font-size: 1rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #374151;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: #2563eb;
  border-color: #2563eb;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✓";
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

/* 반응형 */
@media (max-width: 768px) {
  .login-overlay {
    padding: 1rem;
  }

  .login-container {
    max-width: 100%;
  }

  .login-header {
    padding: 1.5rem 1.5rem 1rem;
  }

  .login-content {
    padding: 1rem 1.5rem 1.5rem;
  }

  .profile-trigger {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .profile-info {
    display: none;
  }

  .profile-menu {
    right: -1rem;
    min-width: 250px;
  }

  .profile-header {
    padding: 1rem;
  }

  .help-modal {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
