/* =====================================================================
   공개 홈페이지 CSS
   학원 홈페이지 느낌의 깔끔한 디자인
   ===================================================================== */

@font-face {
  font-family: 'Paperlogy';
  src: url('/assets/fonts/Paperlogy-Regular.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #2c3e50;
  line-height: 1.6;
}

/* ── 헤더 ────────────────────────────────────────────────────────────── */
.public-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.public-header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.public-logo h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.public-logo p {
  margin: 4px 0 0 0;
  font-size: 13px;
  opacity: 0.9;
}

.public-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

.public-nav-link {
  color: white;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: opacity 0.2s;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.public-nav-link:hover {
  opacity: 0.8;
  border-bottom-color: white;
}

.public-nav-link.is-active {
  border-bottom-color: white;
  font-weight: 600;
}

.public-nav-login {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 6px;
  border-bottom: none;
}

.public-nav-login:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── 메인 콘텐츠 ──────────────────────────────────────────────────────── */
.public-main {
  min-height: calc(100vh - 200px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.public-content {
  width: 100%;
}

.public-header-title {
  margin-bottom: 40px;
  border-bottom: 2px solid #667eea;
  padding-bottom: 20px;
}

.public-header-title h2 {
  margin: 0;
  font-size: 32px;
  color: #2c3e50;
}

.public-header-title p {
  margin: 8px 0 0 0;
  color: #666;
  font-size: 15px;
}

/* 카드 */
.public-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.public-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.public-card h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
  color: #2c3e50;
}

.public-card p {
  margin: 0;
  color: #666;
  line-height: 1.8;
}

/* 알림 */
.alert {
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* 배지 */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-primary {
  background: #dbeafe;
  color: #1e40af;
}

/* 버튼 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  background: #f0f0f0;
  color: #2c3e50;
}

.btn-primary {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn-secondary {
  background: #f0f0f0;
  color: #2c3e50;
  border-color: #ddd;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.public-btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}

.public-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.public-btn-secondary {
  background: #f0f0f0;
  color: #2c3e50;
}

.public-btn-secondary:hover {
  background: #e0e0e0;
}

/* 공지사항 테이블 */
.public-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.public-table thead {
  background: #f5f5f5;
}

.public-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #667eea;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.public-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  color: #555;
}

.public-table tbody tr:hover {
  background: #f9f9f9;
}

.public-table a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.public-table a:hover {
  text-decoration: underline;
}

/* ── 푸터 ────────────────────────────────────────────────────────────── */
.public-footer {
  background: #2c3e50;
  color: white;
  padding: 40px 20px 20px;
  margin-top: 60px;
}

.public-footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 30px;
}

.public-footer-section h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
}

.public-footer-section p {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.8;
}

.public-footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  opacity: 0.7;
}

.public-footer-bottom p {
  margin: 0;
}

.public-footer-reg {
  margin-bottom: 8px !important;
  font-size: 13px;
  opacity: 0.85;
}

.public-footer-reg-missing {
  color: #ffd4d4;
}

.public-footer-links {
  margin-bottom: 10px !important;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.public-footer-sep {
  opacity: 0.4;
}

.public-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.9;
}

.public-link-btn:hover {
  opacity: 1;
}

/* ── 약관/방침 레이어 팝업 ────────────────────────────────────────────── */
.policy-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.policy-modal[hidden] {
  display: none;
}

.policy-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.policy-modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.policy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
}

.policy-modal-header h3 {
  margin: 0;
  font-size: 20px;
  color: #2c3e50;
}

.policy-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 4px;
  border-radius: 6px;
}

.policy-modal-close:hover {
  background: #f0f0f0;
  color: #2c3e50;
}

.policy-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  color: #444;
  line-height: 1.8;
}

.policy-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e0e0e0;
  text-align: right;
}

.policy-doc[hidden] {
  display: none;
}

/* Summernote 로 작성된 본문이 레이아웃을 깨지 않도록 방어 */
.policy-doc img {
  max-width: 100%;
  height: auto;
}

.policy-doc table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
}

.policy-doc table td,
.policy-doc table th {
  border: 1px solid #ddd;
  padding: 8px 10px;
}

.policy-empty {
  color: #999;
  text-align: center;
  padding: 40px 0;
}

@media (max-width: 768px) {
  .policy-modal-content {
    max-height: 90vh;
  }

  .policy-modal-body {
    padding: 16px;
  }
}

/* 폼 */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: 14px;
  color: #2c3e50;
}

.form-group label.required::after {
  content: ' *';
  color: #ef4444;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Paperlogy', sans-serif;
  color: #2c3e50;
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="tel"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="date"]:focus,
.form-group input[type="datetime-local"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 11px;
  margin-top: 16px;
}

/* ── 페이지네이션 ────────────────────────────────────────────────────── */
.public-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.public-pagination a,
.public-pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: white;
  color: #2c3e50;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
  min-width: 40px;
  text-align: center;
}

.public-pagination a:hover,
.public-pagination button:hover {
  border-color: #667eea;
  color: #667eea;
}

.public-pagination button.is-active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

/* ── 반응형 ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .public-header-content {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }

  .public-nav {
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
  }

  .public-nav-link {
    font-size: 14px;
  }

  .public-logo h1 {
    font-size: 24px;
  }

  .public-main {
    padding: 20px;
  }

  .public-header-title h2 {
    font-size: 24px;
  }

  .public-card {
    padding: 16px;
  }

  .public-footer-content {
    gap: 20px;
  }

  .public-table {
    font-size: 13px;
  }

  .public-table th,
  .public-table td {
    padding: 8px 12px;
  }
}
