* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #1e4562 !important;
  min-height: 100vh;
  padding: 0 !important;
  margin: 0 !important;
}

.container {
  max-width: 800px;
  margin: 20px auto !important;
  padding: 0 !important;
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.test-header {
  background: linear-gradient(135deg, #1e4562 0%, #2563eb 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

.test-header h1 {
  font-size: 2em;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.test-subtitle {
  font-size: 0.9em;
  margin-bottom: 20px;
  opacity: 0.9;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.instructions-box {
  background: rgba(255, 255, 255, 0.15);
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
  backdrop-filter: blur(10px);
}

.instructions-title {
  font-size: 1.1em;
  font-weight: 700;
  margin-bottom: 10px;
}

.instructions-text {
  font-size: 0.9em;
  margin-bottom: 15px;
  line-height: 1.6;
}

.scale-guide {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.9em;
  font-weight: 600;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.scale-guide span:nth-child(2) {
  font-size: 1.2em;
  opacity: 0.7;
}

.test-container {
  padding: 30px;
}

.category-section {
  margin-bottom: 40px;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 25px;
  background: #f8f9fa;
}

.category-title {
  font-size: 1.6em;
  color: #1e4562;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #1e4562;
  font-weight: 600;
}

.question-item {
  margin-bottom: 20px;
  padding: 20px;
  background: white;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}

.question-text {
  font-size: 1.1em;
  margin-bottom: 12px;
  font-weight: 500;
  color: #333;
  line-height: 1.5;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.scale-labels span {
  font-size: 0.85em;
  color: #888;
  font-weight: 500;
}

.radio-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 50px;
  height: 50px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 1.1em;
  color: #666;
  background: white;
}

.radio-group label:hover {
  border-color: #1e4562;
  background-color: #e0f2fe;
  color: #1e4562;
}

.radio-group input[type='radio'] {
  display: none;
}

.radio-group label:has(input[type='radio']:checked) {
  background-color: #1e4562;
  border-color: #1e4562;
  color: white;
  font-weight: 700;
}

.submit-section {
  text-align: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #e9ecef;
}

.submit-btn {
  background: #1e4562;
  color: white;
  border: none;
  padding: 16px 50px;
  font-size: 1.2em;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  min-width: 200px;
  width: auto;
}

.submit-btn:hover {
  background: #163549;
}

.submit-btn:active {
  background: #0f2838;
}

/* 결과 화면 스타일 */
.result-container {
  padding: 30px;
}

/* 결과 메인 섹션 */
.result-main {
  text-align: center;
  padding: 30px 20px 20px;
  margin-bottom: 20px;
}

.result-intro {
  font-size: 1.2em;
  color: #666;
  margin-bottom: 15px;
}

.score-number {
  font-size: 5em;
  font-weight: 800;
  color: #333;
  margin-bottom: 8px;
}

.score-rank {
  font-size: 1.2em;
  color: #666;
  margin-bottom: 15px;
}

.result-type {
  font-size: 2em;
  font-weight: 700;
  margin-top: 10px;
}

.result-type.stable {
  color: #059669;
}

.result-type.exploring {
  color: #0891b2;
}

.result-type.sensitive {
  color: #d97706;
}

.result-type.confused {
  color: #dc2626;
}

.result-type.unstable {
  color: #b91c1c;
}

.result-type.crisis {
  color: #7f1d1d;
}

.result-description {
  background-color: #f8f9fa;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 1.1em;
  line-height: 1.8;
  color: #333;
}

.category-scores {
  margin-bottom: 20px;
  padding-top: 20px;
}

.category-scores h3 {
  font-size: 1.5em;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 600;
}

.score-bars {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.score-bar {
  display: flex;
  align-items: center;
  gap: 15px;
}

.bar-label {
  width: 120px;
  font-weight: 600;
  color: #495057;
  font-size: 0.95em;
}

.bar-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bar-fill {
  height: 20px;
  border-radius: 10px;
  transition: width 1s ease;
  min-width: 0;
}

/* 각 카테고리별 색상 - 이십춘기 6개 영역 (#1E4562 계열) */
#identityBar {
  background: linear-gradient(90deg, #1e4562 0%, #2563eb 100%);
}

#autonomyBar {
  background: linear-gradient(90deg, #1e4562 0%, #0ea5e9 100%);
}

#relationshipBar {
  background: linear-gradient(90deg, #0c4a6e 0%, #06b6d4 100%);
}

#futureAnxietyBar {
  background: linear-gradient(90deg, #1e3a5f 0%, #3b82f6 100%);
}

#selfRegulationBar {
  background: linear-gradient(90deg, #1e4562 0%, #64748b 100%);
}

#meaningBar {
  background: linear-gradient(90deg, #164e63 0%, #0891b2 100%);
}

.bar-score {
  font-weight: 600;
  color: #333;
  min-width: 50px;
  text-align: right;
}

.retake-section {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e9ecef;
}

.retake-btn {
  background: #1e4562;
  color: white;
  border: none;
  padding: 14px 40px;
  font-size: 1.1em;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  min-width: 180px;
  width: auto;
}

.retake-btn:hover {
  background: #163549;
}

.retake-btn:active {
  background: #0f2838;
}

/* 공유 섹션 */
.share-section {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
  padding-top: 20px;
  border-top: 2px solid #e9ecef;
}

.share-title {
  font-size: 1.3em;
  color: #1e4562;
  margin-bottom: 20px;
  font-weight: 600;
}

.share-button-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.share-button-container .footer-share-button {
  width: 45px;
  height: 45px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.share-button-container .footer-share-button:hover {
  transform: scale(1.1);
}

/* 테스트 배너 */
.test-banner-container {
  margin: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.banner-item {
  text-align: center;
}

.banner-item a {
  display: inline-block;
  text-decoration: none;
}

.banner-item img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.banner-item img:hover {
  transform: scale(1.02);
}

/* 하단 고정 바 스타일 추가 */
.newsletter-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.newsletter-popup-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.newsletter-close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.newsletter-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 면책사항 */
.disclaimer {
  text-align: center;
  padding: 20px;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.7);
  max-width: 800px;
  margin: 20px auto;
  line-height: 1.6;
}

/* result.php용 면책사항 (배경 흰색) */
.disclaimer-result {
  text-align: center;
  padding: 20px;
  font-size: 0.85em;
  color: #999;
  max-width: 800px;
  margin: 20px auto 80px;
  line-height: 1.6;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .container {
    margin: 10px auto;
    border-radius: 12px;
  }

  .test-header {
    padding: 30px 20px;
  }

  .test-header h1 {
    font-size: 1.6em;
  }

  .test-subtitle {
    font-size: 0.8em;
  }

  .instructions-box {
    padding: 16px;
  }

  .instructions-title {
    font-size: 1em;
  }

  .instructions-text {
    font-size: 0.85em;
  }

  .scale-guide {
    flex-direction: column;
    gap: 8px;
    font-size: 0.85em;
  }

  .scale-guide span:nth-child(2) {
    display: none;
  }

  .test-container {
    padding: 20px 15px;
  }

  .category-section {
    padding: 18px;
  }

  .category-title {
    font-size: 1.4em;
  }

  .question-item {
    padding: 16px;
  }

  .question-text {
    font-size: 1.05em;
  }

  .scale-labels {
    font-size: 0.75em;
  }

  .radio-group {
    gap: 6px;
  }

  .radio-group label {
    min-width: 45px;
    height: 48px;
    font-size: 1em;
  }

  .submit-btn {
    width: 100%;
    max-width: 400px;
    padding: 16px 30px;
    font-size: 1.15em;
  }

  .result-container {
    padding: 20px 15px;
  }

  .result-main {
    padding: 25px 15px 15px;
  }

  .result-intro {
    font-size: 1.1em;
  }

  .score-number {
    font-size: 4em;
  }

  .score-rank {
    font-size: 1.1em;
  }

  .result-type {
    font-size: 1.8em;
  }

  .score-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .bar-label {
    width: 100%;
    text-align: left;
  }

  .bar-container {
    width: 100%;
  }

  .retake-btn {
    width: 100%;
    max-width: 400px;
    padding: 14px 30px;
  }

  .share-section {
    margin-top: 30px;
    padding-top: 25px;
  }

  .share-title {
    font-size: 1.2em;
  }

  .share-button-container {
    gap: 7px;
  }

  .share-button-container .footer-share-button {
    width: 40px;
    height: 40px;
  }

  .test-banner-container {
    margin: 20px 15px;
    gap: 15px;
  }

  .newsletter-popup-content {
    max-width: 95%;
  }

  .newsletter-close-btn {
    top: -35px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .test-header {
    padding: 25px 15px;
  }

  .test-header h1 {
    font-size: 1.4em;
  }

  .test-subtitle {
    font-size: 0.75em;
  }

  .instructions-box {
    padding: 14px;
  }

  .instructions-title {
    font-size: 0.95em;
  }

  .instructions-text {
    font-size: 0.8em;
  }

  .scale-guide {
    font-size: 0.8em;
  }

  .category-title {
    font-size: 1.2em;
  }

  .question-text {
    font-size: 1em;
  }

  .scale-labels {
    font-size: 0.7em;
    padding: 0;
  }

  .radio-group label {
    min-width: 40px;
    height: 46px;
    font-size: 0.95em;
  }

  .submit-btn {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1em;
  }

  .result-main {
    padding: 20px 15px 15px;
  }

  .result-intro {
    font-size: 1em;
  }

  .score-number {
    font-size: 3.5em;
  }

  .score-rank {
    font-size: 1em;
  }

  .result-type {
    font-size: 1.6em;
  }

  .retake-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1em;
  }

  .share-title {
    font-size: 1.1em;
  }

  .share-button-container .footer-share-button {
    width: 38px;
    height: 38px;
  }

  .test-banner-container {
    margin: 15px 10px;
    gap: 12px;
  }

  .disclaimer,
  .disclaimer-result {
    font-size: 0.8em;
    padding: 15px;
  }
}
