/**
 * 기본 스타일시트
 */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Malgun Gothic', '맑은 고딕', Arial, sans-serif;
  line-height: 1;
  color: #333;
  background-color: #f5f5f5;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
  margin-bottom: 30px;
  color: #2c3e50;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

.required {
  color: #e74c3c;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: #3498db;
}

select:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.error {
  display: none;
  color: #e74c3c;
  font-size: 12px;
  margin-top: 5px;
}

.contact-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contact-separator {
  font-size: 18px;
  color: #666;
  font-weight: bold;
}

.email-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
  margin-left: 10px;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.message {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.message-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Notification 스타일 */
.notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 300px;
  max-width: 90%;
  width: fit-content;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeIn 0.3s ease-out;
}

#notification-message {
  white-space: nowrap;
  flex: 0 1 auto;
}

@keyframes fadeIn {
  from {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.notification-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.notification-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.notification-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  margin-left: 15px;
  padding: 0;
  line-height: 1;
}

.notification-close:hover {
  opacity: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

table th {
  background-color: #f8f9fa;
  font-weight: bold;
}

table tr:hover {
  background-color: #f5f5f5;
}

/* 헤더 스타일 */
.main-header {
  background: linear-gradient(120deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
  color: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
  position: relative;
  overflow: hidden;
}

.main-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: headerShine 8s ease-in-out infinite;
}

@keyframes headerShine {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-20%, -20%) rotate(180deg); }
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
}

.system-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
  color: white;
}

.user-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 6px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-label {
  font-weight: bold;
  font-size: 14px;
  min-width: 80px;
}

.info-value {
  font-size: 14px;
}

.admin-badge {
  background-color: #ffc107;
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 12px;
}

.status-active {
  color: #90ee90;
  font-weight: bold;
}

.status-expired {
  color: #ff6b6b;
  font-weight: bold;
}

/* 네비게이션 스타일 */
.main-nav {
  background: white;
  padding: 0;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  flex: 1;
  min-width: 150px;
}

.nav-link {
  display: block;
  padding: 15px 20px;
  text-align: center;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
}

.nav-link:hover {
  background-color: #f8f9fa;
  border-bottom-color: #3b82f6;
  color: #3b82f6;
}

.nav-link.admin-link {
  color: #ffc107;
}

.nav-link.admin-link:hover {
  border-bottom-color: #ffc107;
}

.nav-link.logout-link {
  color: #dc3545;
}

.nav-link.logout-link:hover {
  border-bottom-color: #dc3545;
  background-color: #fff5f5;
}


/* 메인 콘텐츠 */
.main-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-content h2 {
  margin-bottom: 20px;
  color: #2c3e50;
}

/* 시뮬레이션 카드 */
.simulation-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.simulation-card {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: all 0.3s;
}

.simulation-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.simulation-card h3 {
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 20px;
}

.simulation-card p {
  margin-bottom: 20px;
  color: #666;
  line-height: 1;
}

.simulation-card .btn {
  width: 100%;
  text-align: center;
}

/* 인증 페이지 공통 스타일 (로그인, 회원가입, 비밀번호 초기화, 아이디 찾기) */
body.auth-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0;
  background: linear-gradient(120deg, #0f172a 0%, #1e293b 30%, #334155 60%, #475569 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

body.auth-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(96, 165, 250, 0.15) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body.auth-page > * {
  position: relative;
  z-index: 1;
}

.auth-container {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 45px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-title {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
}

.auth-form {
  width: 100%;
}

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
  font-size: 14px;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"],
.auth-form input[type="tel"],
.auth-form select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="email"]:focus,
.auth-form input[type="tel"]:focus,
.auth-form select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.auth-form .btn {
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s;
}

.auth-form .btn-primary {
  background: linear-gradient(120deg, #1e40af 0%, #3b82f6 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.auth-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.5);
  background: linear-gradient(120deg, #1e3a8a 0%, #2563eb 100%);
}

.auth-form .btn-secondary {
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  color: #666;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-form .btn-secondary:hover {
  background: #e8e8e8;
}

.auth-form .message {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.auth-form .error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 5px;
  display: block;
}

/* 이메일 입력 그룹 */
.email-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.email-input-group input[type="text"],
.email-input-group select {
  flex: 1;
  max-width: 100%;
}

.email-input-group span {
  font-size: 18px;
  color: #666;
  flex-shrink: 0;
}

/* 로그인 링크 */
.login-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e0e0e0;
  flex-wrap: wrap;
}

.login-links a {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
  position: relative;
}

.login-links a:hover {
  color: #3b82f6;
}

.login-links a:not(:last-child)::after {
  content: '|';
  margin-left: 12px;
  color: #ccc;
}

/* 결과 박스 (아이디 찾기 등) */
.result-box {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #ddd;
  text-align: center;
  display: none;
}

.result-box.success {
  background: #d4edda;
  border-color: #c3e6cb;
  color: #155724;
}

.result-box.error {
  background: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.result-user-id {
  font-size: 18px;
  font-weight: 600;
  margin-top: 10px;
  color: #4CAF50;
}

/* Footer 여백 조정 (body에 padding이 있는 페이지용) */
body:not(.auth-page) .main-footer {
  margin-left: -20px !important;
  margin-right: -20px !important;
  margin-top: 20px !important;
  width: calc(100% + 40px) !important;
  max-width: none !important;
}