/* ==============================
   Root Variables
============================== */
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;

  --primary: #3b5bdb;
  --primary-dark: #2746b8;
  --primary-soft: #eef2ff;

  --border: #e5e7eb;
  --danger: #ef4444;
  --success: #16a34a;
  --warning: #f59e0b;

  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

/* ==============================
   Base Reset
============================== */
* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 91, 219, 0.14), transparent 32%),
    linear-gradient(180deg, #f8faff 0%, var(--bg) 100%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body > main {
  flex: 1;
}

a {
  color: inherit;
}

img,
video {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 16px;
}

button {
  transition: 0.18s;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled,
input[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

input,
select,
textarea,
button {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  word-break: keep-all;
}

h1 {
  letter-spacing: -0.04em;
}

p {
  line-height: 1.6;
}

/* ==============================
   Common Layout
============================== */
.container {
  width: min(1080px, 92%);
  margin: 56px auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover {
  color: var(--primary-dark);
}

.empty-box {
  margin-top: 30px;
  padding: 48px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.notice-box {
  margin-top: 24px;
  padding: 16px 18px;
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  color: #3346a3;
  font-weight: 700;
}

/* ==============================
   Public Header
============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(23, 37, 84, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
}

.site-header-inner {
  width: min(1280px, 92%);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.site-logo {
  color: white;
  text-decoration: none;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.05em;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 9px 12px;
  color: #dbeafe;
  text-decoration: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  transition: 0.18s;
  white-space: nowrap;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.13);
  color: white;
}

/* ==============================
   404 Page
============================== */
.not-found-card {
  max-width: 680px;
  margin: 80px auto;
  padding: 54px 36px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 30px;
  box-shadow: var(--shadow);
  text-align: center;
}

.not-found-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
}

.not-found-card h1 {
  margin: 22px 0 12px;
  color: #172554;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -0.05em;
}

.not-found-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 700;
}

.not-found-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.not-found-primary,
.not-found-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 900;
}

.not-found-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 12px 24px rgba(59, 91, 219, 0.22);
}

.not-found-secondary {
  background: #f3f4f6;
  color: #4b5563;
}

/* ==============================
   Policy Pages
============================== */
.policy-page {
  padding: 40px 16px 20px;
}

.policy-container {
  max-width: 850px;
  margin: 0 auto;
  padding: 32px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  color: #1f2937;
  line-height: 1.7;
}

.policy-container h1 {
  margin-bottom: 28px;
  font-size: 28px;
  color: #111827;
}

.policy-container h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 19px;
  color: #111827;
}

.policy-container p {
  margin: 8px 0;
}

.policy-container ul {
  margin: 8px 0 0;
  padding-left: 22px;
}

.policy-date {
  margin-top: 32px !important;
  color: #6b7280;
  font-size: 14px;
}

/* ==============================
   Footer
============================== */
.sh-footer {
  width: 100%;
  margin-top: 60px;
  padding: 28px 16px;
  border-top: 1px solid #1f2937;
  background: #374151;
  color: #f9fafb;
}

.sh-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.sh-footer-brand strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.sh-footer-brand p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #e0e1e2;
}

.sh-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.sh-footer-links a {
  color: #cacaca;
  text-decoration: none;
}

.sh-footer-links a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.sh-footer-links span {
  color: #9ca3af;
}

.sh-footer-copy {
  margin: 0;
  font-size: 13px;
  color: #dadada;
}

/* ==============================
   User Auth Header
============================== */
.site-user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.site-logout-form {
  margin: 0;
  flex-shrink: 0;
}

.site-logout-form button {
  padding: 9px 12px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .site-user-badge,
  .site-logout-form button {
    font-size: 13px;
  }
}

/* ==============================
   Header Logo
============================== */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.site-logo-mark {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(199, 210, 254, 0.8);
  border-radius: 12px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.site-logo-mark img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transform: scale(2.09);
}

.site-logo span:last-child {
  line-height: 1;
}

@media (max-width: 760px) {
  .site-logo-mark {
    width: 50px;
    height: 50px;
  }

  .site-logo-mark img {
    width: 33px;
    height: 35px;
  }
}

/* ==============================
   Mobile Common
============================== */
@media (max-width: 760px) {
  .site-header-inner {
    min-height: auto;
    padding: 14px 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-logo {
    font-size: 22px;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex-shrink: 0;
    padding: 9px 12px;
  }
}

@media (max-width: 600px) {
  body {
    background:
      radial-gradient(circle at top left, rgba(59, 91, 219, 0.11), transparent 34%),
      linear-gradient(180deg, #f8faff 0%, var(--bg) 100%);
  }

  .container {
    width: min(100% - 28px, 1080px);
    margin: 34px auto;
  }

  .back-link {
    margin-bottom: 18px;
    font-size: 14px;
  }

  .empty-box {
    margin-top: 22px;
    padding: 34px 18px;
    border-radius: 16px;
  }

  .notice-box {
    padding: 14px 15px;
    border-radius: 13px;
    font-size: 14px;
  }

  .policy-container {
    padding: 24px 18px;
    border-radius: 14px;
  }

  .policy-container h1 {
    font-size: 24px;
  }

  .sh-footer {
    margin-top: 40px;
    padding: 24px 14px;
  }

  .sh-footer-links {
    flex-wrap: wrap;
    font-size: 13px;
  }

  .sh-footer-brand strong {
    font-size: 17px;
  }
}

@media (max-width: 520px) {
  .not-found-card {
    margin: 50px auto;
    padding: 40px 24px;
    border-radius: 24px;
  }

  .not-found-primary,
  .not-found-secondary {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(100% - 22px, 1080px);
    margin: 28px auto;
  }

  .site-logo {
    font-size: 20px;
  }

  .site-nav a {
    font-size: 13px;
  }
}

/* ==============================
   Mobile Home Layout
============================== */
@media (max-width: 760px) {
  .home-container {
    width: min(100% - 28px, 1100px);
    margin: 0 auto;
  }

  .hero-section {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 42px 0 28px;
  }

  .hero-text {
    text-align: left;
  }

  .hero-badge {
    font-size: 12px;
    padding: 7px 10px;
  }

  .hero-text h1 {
    font-size: clamp(42px, 15vw, 62px);
    line-height: 0.95;
    margin: 14px 0 14px;
  }

  .hero-text p {
    font-size: 16px;
    line-height: 1.75;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 22px;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
    justify-content: center;
    padding: 14px 18px;
    font-size: 15px;
  }

  .hero-card {
    width: 100%;
    padding: 26px;
    border-radius: 26px;
  }

  .hero-card h2 {
    font-size: 26px;
  }

  .hero-card p {
    font-size: 15px;
    line-height: 1.7;
  }

  .hero-mini-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-mini-grid div {
    padding: 16px;
  }

  .school-section {
    margin-top: 26px;
    padding: 26px;
    border-radius: 26px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }

  .section-header h2 {
    font-size: 30px;
  }

  .section-header p {
    font-size: 15px;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
    height: 48px;
    font-size: 16px;
  }

  .school-list {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 22px;
  }

  .school-card {
    min-height: auto;
    padding: 24px;
    border-radius: 22px;
  }

  .school-card h3 {
    font-size: 24px;
  }

  .school-card p {
    font-size: 15px;
  }

  .school-badge {
    font-size: 12px;
    padding: 7px 10px;
  }
}

@media (max-width: 430px) {
  .home-container {
    width: min(100% - 22px, 1100px);
  }

  .hero-section {
    padding-top: 32px;
  }

  .hero-text h1 {
    font-size: 44px;
  }

  .hero-card {
    padding: 22px;
  }

  .school-section {
    padding: 22px;
  }

  .section-header h2 {
    font-size: 28px;
  }

  .school-card {
    padding: 22px;
  }
}

/* ==============================
   v1.2.1 Mobile App-like Polish
============================== */
@media (max-width: 760px) {
  :root {
    --shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    --radius: 18px;
  }

  body {
    background:
      linear-gradient(180deg, #f8faff 0%, #f4f6fb 48%, #eef2ff 100%);
  }

  .site-header {
    background: rgba(1, 1, 34, 0.932);
    border-bottom: 1px solid rgba(199, 210, 254, 0.75);
    backdrop-filter: blur(18px);
  }

  .site-logo {
    color: #ffffff;
  }

  .site-nav {
    gap: 7px;
  }

  .site-nav a {
    background: #efefff;
    color: #475569;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.03);
  }

  .site-nav a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .container {
    margin-top: 24px;
  }

  .back-link {
    padding: 8px 11px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.04);
  }

  .empty-box,
  .notice-box,
  .not-found-card,
  .policy-container {
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  }

  button,
  a {
    -webkit-tap-highlight-color: transparent;
  }
}

/* ==============================
   Public Header Dropdown
============================== */
.site-nav-dropdown {
  position: relative;
  flex-shrink: 0;
}

.site-nav-dropdown summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  color: #dbeafe;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s;
  white-space: nowrap;
}

.site-nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.site-nav-dropdown summary::after {
  content: "▾";
  font-size: 10px;
  opacity: 0.75;
}

.site-nav-dropdown[open] summary::after {
  transform: rotate(180deg);
}

.site-nav-dropdown summary:hover,
.site-nav-dropdown[open] summary {
  background: rgba(255, 255, 255, 0.13);
  color: white;
}

.site-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 999;
  min-width: 150px;
  padding: 8px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.site-nav-dropdown[open] .site-dropdown-menu {
  display: grid;
  gap: 4px;
}

.site-dropdown-menu a {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 12px;
  color: #374151;
  background: transparent;
  border-radius: 12px;
}

.site-dropdown-menu a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.site-header,
.site-header-inner {
  overflow: visible;
}

@media (min-width: 761px) {
  .site-nav {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .site-nav-dropdown summary {
    background: #f3f4f6;
    color: #475569;
    border: 1px solid #e5e7eb;
  }

  .site-nav-dropdown summary:hover,
  .site-nav-dropdown[open] summary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .site-dropdown-menu {
    position: fixed;
    left: 14px;
    right: 14px;
    top: 92px;
    min-width: auto;
    border-radius: 18px;
  }
}