/* ==================== 기본 스타일 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==================== 헤더 ==================== */
.header {
  background-color: #fff;
  padding: 12px 0;
  border-bottom: 1px solid #cfcfcf;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: center;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  height: 100%;
}

.logo-link:visited,
.logo-link:link {
  color: inherit;
}

.logo-link:hover .logo-text,
.logo-link:hover .logo-subtitle {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.logo-image {
  max-width: 180px;
  height: auto;
  display: block;
  border-radius: 2px;
  vertical-align: middle;
}

.header-separator {
  font-size: 18px;
  color: #bbb;
  margin: 0 8px;
  display: flex;
  align-items: flex-end;
  height: 100%;
  line-height: 1;
}

.header-title {
  font-size: 15px;
  color: #444;
  font-weight: 500;
  display: flex;
  align-items: flex-end;
  height: 100%;
  white-space: nowrap;
  line-height: 1;
}

.header-subtitle {
  max-width: 1200px;
  margin: 8px auto 0;
  padding: 0 15px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #222;
}

/* ==================== 메인 콘텐츠 ==================== */
.main-content {
  flex: 1;
  padding: 40px 15px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.form-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 28px 22px;
  width: 100%;
  max-width: 460px;
}

.page-title {
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 0;
  border-bottom: none;
}

.page-title h1 {
  font-size: 20px;
  color: #e60012;
  font-weight: 600;
  line-height: 1.4;
}

/* ==================== 폼 스타일 ==================== */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  margin-bottom: 0;
}

.form-input {
  padding: 11px 12px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.2s ease;
  background-color: #fff;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: #e60012;
  box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.1);
}

.form-input::placeholder {
  color: #999;
  font-size: 12px;
}

.form-input.error {
  border-color: #e60012;
  background-color: #fff5f5;
}

/* 생년월일 및 주민번호 행 */
.form-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* phone input row used on stock-partner-form */
.phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.phone-row .form-input {
  flex: 1 1 auto;
  width: auto; /* allow flex to control width */
}

.date-input {
  flex: 0 0 auto;
  width: 110px;
}

.id-input {
  flex: 0 0 auto;
  width: 50px;
}

.separator {
  font-size: 13px;
  color: #666;
  font-weight: 600;
  flex-shrink: 0;
}

.separator-dot {
  color: #e60012;
  font-weight: bold;
  flex-shrink: 0;
}

/* 에러 메시지 */
.error-message {
  font-size: 12px;
  color: #e60012;
  margin-top: 4px;
  min-height: 16px;
}

/* ==================== 체크박스 섹션 ==================== */
.checkbox-section {
  background-color: #fef3f3;
  border: 1px solid #f0d8d8;
  border-radius: 4px;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;  
}

.checkbox-group:first-child {
  border-bottom: 1px solid #f0d8d8;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  flex: 1;
}

.checkbox-input {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #e60012;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-text {
  color: #333;
  font-weight: 500;
  flex: 1;
}

.link-secondary {
  color: #e60012;
  text-decoration: underline;
  text-decoration-color: #df5b66;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  display: inline-block;
  vertical-align: middle;
}

.link-secondary:hover {
  color: #c40010;
  text-decoration-color: #bf4f56;
}

/* ==================== 버튼 ==================== */
.btn-primary {
  padding: 13px 16px;
  background-color: #e60012;
  color: white;
  border: 2px solid #e60012;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
  margin-top: 15px;
}

.btn-primary:hover {
  background-color: #c40010;
  border-color: #c40010;
  box-shadow: 0 2px 8px rgba(230, 0, 18, 0.3);
}

.btn-primary:active {
  background-color: #a30008;
  border-color: #a30008;
}

.btn-primary:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 13px 16px;
  background-color: #f5f5f5;
  color: #333;
  border: 2px solid #d0d0d0;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
  margin-top: 15px;
}

.btn-secondary:hover {
  background-color: #e8e8e8;
  border-color: #b0b0b0;
}

.btn-secondary:active {
  background-color: #d8d8d8;
  border-color: #a0a0a0;
}

.btn-secondary:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
  color: #999;
}

/* ==================== 푸터 ==================== */
.footer {
  background-color: #f9f9f9;
  border-top: 1px solid #e0e0e0;
  padding: 20px 15px;
  text-align: center;
  margin-top: auto;
}

.footer-links {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-link {
  color: #555;
  text-decoration: none;
  font-size: 13px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 6px;
  display: inline;
  font-weight: 600;
}

.footer-sep {
  color: #bbb;
  padding: 0 4px;
  font-weight: 600;
}

.footer-link:hover {
  color: #333;
  text-decoration: underline;
}

.footer-copyright {
  color: #bbb;
  font-size: 11px;
}

.footer-copyright p {
  margin: 0;
}

/* ==================== 토스트 ==================== */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  opacity: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #fff;
  color: #333;
  padding: 14px 18px;
  border-radius: 12px;
  min-width: 300px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #16a34a;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex: 0 0 auto;
}

/* ==================== 모달 ==================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  padding: 20px 15px;
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 0;
}

body.modal-open {
  overflow: hidden;
}

.modal-content {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: #555;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
}

.modal-body h3 {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin: 15px 0 10px 0;
}

.modal-body h4 {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin: 12px 0 8px 0;
}

.modal-body p {
  margin: 10px 0;
  text-align: justify;
}

.modal-body .modal-description {
  text-align: center !important;
}

.modal-body ul {
  margin: 10px 0;
  padding-left: 20px;
}

.modal-body ul li {
  margin: 6px 0;
}

.modal-description {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
  line-height: 1.8;
  font-size: 14px;
}

.contact-modal {
  max-width: 500px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 15px 0;
}

.contact-person {
  background-color: #fef3f3;
  padding: 20px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid #f0d8d8;
}

.contact-person h3 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
  margin-bottom: 10px;
}

.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e60012;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}

.phone-link:hover {
  text-decoration: underline;
}

.phone-icon {
  font-size: 14px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  text-align: right;
  flex: 0 0 auto;
}

.modal-footer .btn-primary {
  margin-top: 0;
  width: 100%;
}

/* ==================== 본인인증 모달 ==================== */
.otp-modal {
  max-width: 360px;
  border-radius: 14px;
}

.otp-modal-header {
  padding: 22px 20px 8px;
  text-align: center;
}

.otp-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.otp-modal-body {
  padding: 0 22px 18px;
  text-align: center;
}

.otp-modal-desc {
  font-size: 13px;
  color: #666;
  margin: 8px 0 18px;
  line-height: 1.5;
}

.otp-input-group {
  text-align: center;
}

.otp-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}

.otp-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.otp-input {
  width: 160px;
  text-align: center;
  border: 2px solid #e60012;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.otp-input:focus {
  outline: none;
  border-color: #e60012;
  box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.12);
}

.otp-timer {
  color: #e60012;
  font-weight: 700;
  font-size: 13px;
  min-width: 38px;
  text-align: left;
}

.otp-modal-actions {
  display: flex;
  gap: 10px;
  padding: 0 22px 22px;
}

.btn-outline {
  flex: 1 1 0;
  padding: 12px 10px;
  background-color: #fff;
  color: #e60012;
  border: 2px solid #e60012;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background-color: #fff5f5;
}

.otp-confirm-btn {
  flex: 1 1 0;
  margin-top: 0;
  border-radius: 10px;
  padding: 12px 10px;
  font-size: 14px;
}

#fileModal .modal-footer .btn-primary {
  width: auto;
  padding: 12px 20px;
}

/* ==================== 삭제 확인 모달 ==================== */
#deleteConfirmModal .modal-content.delete-modal {
  border-radius: 12px;
  max-width: 460px;
}

#deleteConfirmModal .modal-body {
  padding: 36px 24px;
}

.delete-modal-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.delete-btn {
  min-width: 120px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid #e60012;
  background-color: #fff;
  color: #e60012;
}

.delete-btn-yes {
  background-color: #e60012;
  color: #fff;
}

/* ==================== 반응형 디자인 ==================== */
@media (max-width: 600px) {
  .logo-text {
    font-size: 22px;
  }

  .logo-subtitle {
    font-size: 12px;
  }

  .header-separator {
    font-size: 16px;
    margin: 0 6px;
  }

  .header-title {
    font-size: 13px;
  }

  .header-subtitle {
    font-size: 15px;
    padding: 8px 10px;
  }

  .form-container {
    padding: 25px 15px;
  }

  .form {
    gap: 8px;
  }

  .page-title h1 {
    font-size: 18px;
  }

  .checkbox-section {
    margin: 8px 0;
    padding: 0;
  }

  .checkbox-group {
    padding: 8px 12px;
  }

  .footer-links {
    gap: 10px;
  }

  .footer-link {
    font-size: 11px;
  }

  .form-row {
    flex-wrap: wrap;
  }

  .date-input {
    width: 100px;
  }

  .separator,
  .separator-dot {
    font-size: 14px;
  }

  .modal {
    padding: 15px 10px;
  }

  .modal.show {
    padding-top: 20px;
  }

  .modal-content {
    max-width: 100%;
    max-height: 90vh;
  }

  .modal-header {
    padding: 15px;
  }

  .modal-body {
    padding: 15px;
  }

  .modal-footer {
    padding: 12px 15px;
  }
}

@media (max-width: 400px) {
  .logo-text {
    font-size: 24px;
  }

  .logo-subtitle {
    font-size: 16px;
  }

  .header-separator {
    font-size: 22px;
    margin: 0 5px;
  }

  .header-title {
    font-size: 14px;
  }

  .header-subtitle {
    font-size: 16px;
  }

  .form-container {
    padding: 20px 12px;
  }

  .form {
    gap: 8px;
  }

  .form-label {
    font-size: 12px;
  }

  .form-input {
    font-size: 12px;
    padding: 10px 10px;
  }

  .checkbox-section {
    margin: 6px 0;
    padding: 0;
  }

  .checkbox-group {
    padding: 8px 10px;
  }

  .page-title h1 {
    font-size: 16px;
  }

  .btn-primary {
    font-size: 14px;
    padding: 12px 12px;
  }
}

/* ==================== 유틸리티 ==================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-error {
  color: #e60012;
  font-size: 12px;
  margin-top: 4px;
}

/* ==================== 접근성 ==================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== 인쇄 ==================== */
@media print {
  .modal {
    display: none;
  }

  .footer {
    border-top: 1px solid #ccc;
  }
}
