/* 중소기업자금119 - 메인 스타일시트 */

/* CSS 변수 정의 */
:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 전역 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: #ffffff;
}

/* 네비게이션 */
nav {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.logo-text {
  display: flex;
  flex-direction: column;
  color: white;
}

.logo-text .top {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.logo-text .bottom {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.nav-menu {
  display: flex;
  gap: 8px;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.nav-menu a.active {
  background: rgba(255, 255, 255, 0.3);
  font-weight: 700;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
}

/* 메인 컨테이너 */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 카드 스타일 */
.card {
  background: white;
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}

.card.shadow {
  box-shadow: var(--shadow-lg);
}

/* 섹션 스타일 */
.about-section {
  margin-bottom: 40px;
}

section h2 {
  color: var(--primary-color);
  font-size: 28px;
  margin-bottom: 20px;
  font-weight: 700;
}

/* 폼 카드 스타일 */
.form-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-xl);
  margin-bottom: 32px;
}

.form-card h2 {
  color: var(--primary-color);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.form-desc {
  text-align: center;
  color: var(--text-gray);
  font-size: 16px;
  margin-bottom: 32px;
  line-height: 1.8;
}

/* 입력 폼 스타일 */
.input-form {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.form-grid > div {
  display: flex;
  flex-direction: column;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.form-grid label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 15px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
  font-family: inherit;
  background: white;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-grid textarea {
  resize: vertical;
  min-height: 100px;
}

/* 제출 버튼 */
.submit-btn {
  width: 100%;
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

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

.submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

/* 기존 폼 그룹 스타일 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* 체크박스 그룹 */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* 버튼 스타일 */
.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--accent-color);
  color: white;
}

.btn-secondary:hover {
  background: #d97706;
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-full {
  width: 100%;
  margin-top: 20px;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.feature-item {
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-item .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.feature-item h4 {
  color: var(--primary-color);
  font-size: 20px;
  margin-bottom: 12px;
  font-weight: 700;
}

.feature-item p {
  color: var(--text-gray);
  line-height: 1.6;
}

/* 통계 박스 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.stat-box {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
}

.stat-number {
  font-size: 36px;
  font-weight: 900;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
}

/* 성공 사례 그리드 */
.success-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.success-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 28px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
}

.success-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
}

.success-card .tag {
  display: inline-block;
  background: var(--bg-light);
  color: var(--primary-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 16px;
}

.success-card h3 {
  color: var(--text-dark);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.success-card .amount {
  font-size: 26px;
  font-weight: 900;
  color: var(--accent-color);
  margin: 16px 0;
}

.success-card p {
  color: var(--text-gray);
  line-height: 1.9;
  font-size: 15px;
}

.success-card p strong {
  color: var(--text-dark);
  font-weight: 600;
}

/* 기존 case 스타일 (하위 호환) */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.case-card {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s ease;
}

.case-card:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.case-tag {
  display: inline-block;
  background: var(--bg-light);
  color: var(--primary-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}

.case-amount {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent-color);
  margin: 12px 0;
}

/* 알림 메시지 */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid;
}

.alert-success {
  background: #d1fae5;
  border-color: var(--success-color);
  color: #065f46;
}

.alert-warning {
  background: #fef3c7;
  border-color: var(--warning-color);
  color: #92400e;
}

.alert-error {
  background: #fee2e2;
  border-color: var(--error-color);
  color: #991b1b;
}

/* Footer */
footer {
  background: var(--text-dark);
  color: white;
  text-align: center;
  padding: 32px 20px;
  margin-top: 60px;
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    margin-top: 16px;
  }

  .nav-menu.active {
    display: flex;
  }

  .main-container {
    padding: 20px 16px;
  }

  .card {
    padding: 20px;
  }

  .form-card {
    padding: 24px 20px;
  }

  .form-card h2 {
    font-size: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .success-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .checkbox-group {
    grid-template-columns: 1fr;
  }

  section h2 {
    font-size: 24px;
  }

  .stat-number {
    font-size: 28px;
  }

  .submit-btn {
    font-size: 16px;
    padding: 16px 24px;
  }
}

@media (max-width: 480px) {
  .logo-text .top {
    font-size: 14px;
  }

  .logo-text .bottom {
    font-size: 18px;
  }

  section h2 {
    font-size: 20px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }
}

/* 로딩 스피너 */
.spinner {
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 테이블 스타일 */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

table th {
  background: var(--bg-light);
  font-weight: 700;
  color: var(--primary-color);
}

table tr:hover {
  background: var(--bg-light);
}

/* 유틸리티 클래스 */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-gray { color: var(--text-gray); }