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

:root {
  /* 광진전문가집단학원 브랜드 색상 (홈페이지와 동일 계열) */
  --navy: #16215c;
  --navy-dark: #0b1338;
  --navy-mid: #24347e;
  --gold: #b8860b;
  --gold-light: #d4a92c;
  --bg: #f4f5fa;
  --card: #ffffff;
  --text: #1c2130;
  --muted: #6d7385;
  --border: #e3e6f0;
  --danger: #e5484d;
  --success: #18a058;
  --warn: #d97706;
  --primary: #2f54eb;
  --primary-dark: #1d39c4;
}

body {
  font-family: 'Pretendard Variable', Pretendard, 'Malgun Gothic', '맑은 고딕', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.loading-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; color: var(--muted); font-size: 15px;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ═══════════ 랜딩(로그인) — 홈페이지 느낌 ═══════════ */
.landing {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  gap: 64px; padding: 48px 24px; flex-wrap: wrap;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(58, 80, 180, .55) 0%, transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(184, 134, 11, .18) 0%, transparent 55%),
    linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 70%, var(--navy-mid) 100%);
}
.landing-hero { max-width: 540px; color: #fff; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(212, 169, 44, .55); color: var(--gold-light);
  padding: 8px 18px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  letter-spacing: 2px; margin-bottom: 24px;
}
.landing-hero h1 { font-size: 40px; line-height: 1.24; font-weight: 800; letter-spacing: -0.5px; }
.landing-hero h1 .accent { color: var(--gold-light); }
.hero-sub { margin-top: 16px; font-size: 16.5px; line-height: 1.6; color: rgba(255, 255, 255, .75); }
.hero-points { list-style: none; margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.hero-points li {
  display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  padding: 14px 18px; border-radius: 14px; backdrop-filter: blur(4px);
}

.landing-login { width: 100%; max-width: 400px; }
.login-box {
  background: var(--card); border-radius: 20px; padding: 38px 32px;
  width: 100%; box-shadow: 0 24px 60px rgba(5, 10, 40, .45);
}
.login-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-title-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 20px; }
.login-box label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 7px; color: #3a4157; }
.login-box input, .login-box select {
  width: 100%; padding: 13px 15px; border: 1.5px solid var(--border);
  border-radius: 12px; font-size: 15px; outline: none; background: #fff;
  transition: border-color .15s;
}
.login-box input:focus, .login-box select:focus { border-color: var(--navy); }
.btn-login {
  width: 100%; margin-top: 24px; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(120deg, var(--navy-dark), var(--navy-mid)); color: #fff;
  font-size: 15.5px; font-weight: 800; letter-spacing: .3px;
}
.btn-login:hover { filter: brightness(1.18); }
.btn-login:disabled { opacity: .6; }
.or-divider {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 12px;
  color: var(--muted); font-size: 12.5px;
}
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-signup-big {
  width: 100%; padding: 13px; border-radius: 12px; font-size: 14.5px; font-weight: 800;
  background: #fff; color: var(--gold); border: 1.5px solid var(--gold-light);
}
.btn-signup-big:hover { background: #fdf8ea; }
.login-error {
  margin-top: 14px; padding: 11px 13px; border-radius: 10px;
  background: #fdecec; color: var(--danger); font-size: 13px; display: none;
}
.signup-link { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.signup-link a { color: var(--navy); font-weight: 700; text-decoration: none; }

/* 회원가입 화면 */
.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 32px 16px;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 70%, var(--navy-mid) 100%);
}
.signup-box { max-width: 500px; }
.signup-box .logo { text-align: center; margin-bottom: 8px; }
.signup-box .logo .icon { font-size: 36px; }
.signup-box .logo h1 { font-size: 21px; margin-top: 8px; }
.signup-box .logo p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.signup-box .subject-checks { margin-top: 10px; }

/* ═══════════ 공통 헤더 ═══════════ */
.topbar {
  background: linear-gradient(90deg, var(--navy-dark), var(--navy));
  padding: 0 22px; height: 62px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 14px rgba(11, 19, 56, .25);
}
.topbar .brand { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 9px; color: #fff; }
.topbar .brand .dot { color: var(--gold-light); }
.topbar .spacer { flex: 1; }
.topbar .user-name { font-size: 13px; color: rgba(255, 255, 255, .75); }
.topbar .btn-logout {
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1);
  color: #fff; border-radius: 9px; padding: 8px 15px; font-size: 13px; font-weight: 600;
}
.topbar .btn-logout:hover { background: rgba(255, 255, 255, .22); }

.container { max-width: 1080px; margin: 0 auto; padding: 28px 20px 70px; }

/* ═══════════ 학생: 홈 ═══════════ */
.home-greet { margin: 4px 0 30px; }
.home-greet h2 { font-size: 25px; font-weight: 800; letter-spacing: -0.3px; }
.home-greet p { color: var(--muted); margin-top: 7px; font-size: 15px; }

.teacher-section { margin-bottom: 38px; }
.teacher-head { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.teacher-bar { width: 5px; height: 24px; border-radius: 3px; background: linear-gradient(var(--gold-light), var(--gold)); }
.teacher-head h3 { font-size: 20px; font-weight: 800; }
.teacher-head .count { font-size: 13px; color: var(--muted); font-weight: 600; padding-top: 5px; }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.subject-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; cursor: pointer; transition: all .16s; text-align: left;
  box-shadow: 0 2px 10px rgba(22, 33, 92, .05);
}
.subject-card:hover {
  border-color: #aab8ec; box-shadow: 0 12px 26px rgba(22, 33, 92, .14); transform: translateY(-3px);
}
.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-teacher { font-size: 13px; font-weight: 700; color: var(--muted); }
.subject-card h3 { font-size: 19px; font-weight: 800; line-height: 1.35; word-break: keep-all; }
.card-go { margin-top: 16px; font-size: 14.5px; font-weight: 800; color: var(--navy); }

.grade-badge {
  display: inline-block; font-size: 12.5px; font-weight: 800; padding: 4px 12px;
  border-radius: 999px; white-space: nowrap;
}
.badge-고1 { background: #e3f1ff; color: #0958d9; }
.badge-고2 { background: #e4f8ec; color: #0f7a3d; }
.badge-고3 { background: #ffeede; color: #c05621; }
.badge-특강 { background: #f3eaff; color: #7c3aed; }

.empty-box {
  background: var(--card); border: 1.5px dashed var(--border); border-radius: 16px;
  padding: 50px 20px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.7;
}

/* ═══════════ 학생: 영상 목록 ═══════════ */
.back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.btn-back {
  border: 1px solid var(--border); background: #fff; border-radius: 10px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 700;
}
.btn-back:hover { background: var(--bg); }

.subject-hero {
  background: linear-gradient(120deg, var(--navy-dark), var(--navy-mid));
  color: #fff; border-radius: 18px; padding: 24px 26px; margin-bottom: 26px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  box-shadow: 0 10px 26px rgba(11, 19, 56, .2);
}
.subject-hero .hero-info { flex: 1; min-width: 200px; }
.subject-hero .s-teacher { font-size: 13.5px; color: var(--gold-light); font-weight: 800; margin-bottom: 7px; letter-spacing: .3px; }
.subject-hero h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-refresh {
  border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .12);
  color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 13.5px; font-weight: 700;
}
.btn-refresh:hover { background: rgba(255, 255, 255, .25); }

.mock-banner {
  background: #fff8e6; border: 1px solid #f5d982; color: #8a6d00;
  border-radius: 12px; padding: 12px 15px; font-size: 13.5px; margin-bottom: 18px;
}

.video-group { margin-bottom: 30px; }
.group-title {
  font-size: 17px; font-weight: 800; margin-bottom: 11px;
  display: flex; align-items: center; gap: 9px;
}
.group-title .g-bar { width: 4px; height: 19px; background: var(--gold); border-radius: 2px; flex-shrink: 0; }
.group-title .g-count { font-size: 13px; color: var(--muted); font-weight: 600; }

.video-list {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(22, 33, 92, .04);
}
.video-row {
  display: flex; align-items: center; gap: 15px; padding: 15px 18px;
  border-bottom: 1px solid var(--border); cursor: pointer; width: 100%;
  background: none; border-left: none; border-right: none; border-top: none; text-align: left;
}
.video-row:last-child { border-bottom: none; }
.video-row:hover { background: #f6f8ff; }
.video-row .play-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
  padding-left: 3px;
}
.video-row .v-name { font-size: 15px; font-weight: 700; word-break: break-all; line-height: 1.4; }
.video-row .v-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ═══════════ 플레이어 모달 ═══════════ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6, 10, 28, .85); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.player-box { width: 100%; max-width: 980px; }
.player-head { display: flex; align-items: center; color: #fff; margin-bottom: 12px; gap: 10px; }
.player-head .p-title { font-size: 15.5px; font-weight: 700; word-break: break-all; }
.player-head .btn-close {
  margin-left: auto; background: rgba(255, 255, 255, .15); color: #fff; border: none;
  border-radius: 9px; padding: 9px 18px; font-size: 13.5px; font-weight: 700; flex-shrink: 0;
}
.player-head .btn-close:hover { background: rgba(255, 255, 255, .32); }
.player-frame { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* ═══════════ 관리자 ═══════════ */
.share-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(120deg, #eef1fb, #f8f4e6);
  border: 1px solid #d9d2b8; border-radius: 14px;
  padding: 15px 18px; margin-bottom: 14px;
}
.share-box .share-label { font-size: 12.5px; font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.share-box .share-url { font-size: 16.5px; font-weight: 800; word-break: break-all; color: var(--navy); }

.drive-banner { border-radius: 11px; padding: 11px 14px; font-size: 13px; margin-bottom: 18px; }
.drive-banner.ok { background: #e9f9f0; border: 1px solid #b8e6cd; color: #116b3d; }
.drive-banner.warn { background: #fff8e6; border: 1px solid #f5d982; color: #8a6d00; }

.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-tabs button {
  border: 1px solid var(--border); background: #fff; border-radius: 10px;
  padding: 10px 20px; font-size: 14px; font-weight: 700; color: var(--muted);
}
.admin-tabs button.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(22, 33, 92, .04);
}
.panel h3 { font-size: 15.5px; margin-bottom: 14px; }
.form-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 12px; font-weight: 700; color: var(--muted); }
.form-field input, .form-field select {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; outline: none;
}
.form-field input:focus, .form-field select:focus { border-color: var(--navy); }

.subject-checks { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.check-teacher {
  font-size: 13.5px; font-weight: 800; margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--border); color: var(--navy);
}
.check-teacher:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.check-grade-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.check-grade-label { font-size: 13px; font-weight: 700; min-width: 40px; padding-top: 5px; color: var(--muted); }
.check-items { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 13px; font-size: 13.5px; cursor: pointer; background: #fff; user-select: none;
}
.check-chip input { accent-color: var(--navy); }
.check-chip.checked { background: #eef1fb; border-color: var(--navy); color: var(--navy); font-weight: 700; }

.btn-primary {
  background: var(--navy); color: #fff; border: none; border-radius: 9px;
  padding: 10px 20px; font-size: 14px; font-weight: 800;
}
.btn-primary:hover { background: var(--navy-mid); }
.btn-primary:disabled { opacity: .6; }
.btn-sub {
  background: #fff; border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 14px; font-size: 13px; font-weight: 600;
}
.btn-sub:hover { background: var(--bg); }
.btn-danger-sub { color: var(--danger); border-color: #f3c2c4; }
.btn-danger-sub:hover { background: #fdecec; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 700;
  padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.data-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: #fafbff; }
.chip-list { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-chip {
  font-size: 11.5px; background: #eef1fb; color: var(--navy);
  border-radius: 999px; padding: 3px 9px; white-space: nowrap; font-weight: 600;
}
.status-badge { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 11px; white-space: nowrap; }
.status-badge.on { background: #e9f9f0; color: var(--success); }
.status-badge.off { background: #fdecec; color: var(--danger); }
.status-badge.pending { background: #fff4e5; color: var(--warn); }
tr.row-pending td { background: #fffdf5; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.row-actions button { font-size: 12px; padding: 6px 10px; }

.folder-link-cell { font-size: 12px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--navy-dark); color: #fff; border-radius: 12px; padding: 13px 24px;
  font-size: 14px; z-index: 200; box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
  max-width: 90vw; text-align: center;
}

/* ═══════════ 모바일 ═══════════ */
@media (max-width: 900px) {
  .landing { gap: 34px; padding: 36px 20px; }
  .landing-hero h1 { font-size: 29px; }
  .hero-sub { font-size: 15px; }
  .hero-points li { font-size: 14px; padding: 12px 15px; }
}
@media (max-width: 640px) {
  .container { padding: 18px 13px 60px; }
  .topbar { padding: 0 14px; }
  .topbar .brand { font-size: 14px; }
  .topbar .user-name { display: none; }
  .home-greet h2 { font-size: 21px; }
  .teacher-head h3 { font-size: 18px; }
  .subject-grid { grid-template-columns: 1fr; }
  .subject-hero { padding: 19px 18px; }
  .subject-hero h2 { font-size: 19px; }
  .form-grid { flex-direction: column; align-items: stretch; }
  .form-field { width: 100%; }
  .landing-hero .hero-points { display: none; }
  .landing { padding: 26px 16px; gap: 24px; }
  .landing-hero { text-align: center; }
  .landing-hero h1 { font-size: 26px; }
}
