/* =====================================================================
   KAPSÜL · BENTO GİRİŞ EKRANI (auth-bento.css, v1.0)
   Solda tebeşir tahtası + öğretmen, sağda mevcut giriş formu.
   Form alanlarının id'leri ve auth.js değişmedi.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Caveat:wght@500;600;700&display=swap');

:root {
  --bn-bg: #F5F2FF;
  --bn-card: #FFFFFF;
  --bn-ink: #1D1B3A;
  --bn-muted: #55527A;
  --bn-line: #E6E2F5;
  --bn-accent: #5B3DF5;
  --bn-soft: #EFEBFF;
  --bn-yellow: #FFE7A3;
  --bn-mint: #CFF5E1;
  --board: #24493A;
  --board-dark: #1B3A2D;
  --chalk: #F3F0E6;
  --wood: #8A5A35;
  --wood-dark: #6B4326;
  /* auth.js ve eski kurallar için geriye dönük değişkenler */
  --primary-color: #5B3DF5;
  --primary-color-rgb: 91, 61, 245;
  --background-color: #F5F2FF;
  --panel-bg: #FFFFFF;
  --text-color: #1D1B3A;
  --light-text-color: #55527A;
  --border-color: #E6E2F5;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bn-bg); color: var(--bn-ink);
  font-family: 'Plus Jakarta Sans', 'Nunito', system-ui, sans-serif;
}

/* ---------- yerleşim ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; flex-wrap: wrap; gap: 24px; padding: 24px;
  align-items: stretch; position: relative; overflow: hidden;
}
.auth-wrap .blob { position: absolute; border-radius: 50%; opacity: .5; pointer-events: none; animation: kbDrift 10s ease-in-out infinite; }
.auth-wrap .blob.b1 { width: 200px; height: 200px; background: var(--bn-yellow); top: -70px; left: 52%; }
.auth-wrap .blob.b2 { width: 240px; height: 240px; background: #CFE8FF; bottom: -90px; left: 38%; border-radius: 56px; animation-delay: -4s; }

.board-side {
  flex: 1.35 1 560px; min-width: 0; position: relative; z-index: 1;
  background: #EAE4FF; border-radius: 32px; padding: 28px 28px 0;
  display: flex; flex-direction: column; overflow: hidden; min-height: 560px;
}
.board-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.board-top .logo {
  width: 64px; height: 64px; border-radius: 18px; background: #FFFFFF;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px -12px rgba(29, 27, 58, .6);
}
.board-top .logo img { height: 52px; width: auto; display: block; }
.board-top b { font-family: 'Bricolage Grotesque', sans-serif; font-size: 20px; font-weight: 800; display: block; }
.board-top span { font-size: 13px; color: var(--bn-muted); }

/* ---------- tahta ---------- */
.board-scene { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 470px; }
.board {
  position: relative; flex: 1; min-height: 340px; margin-bottom: 70px;
  background: radial-gradient(ellipse at 30% 20%, #2C5644 0%, var(--board) 45%, var(--board-dark) 100%);
  border: 14px solid var(--wood); border-bottom-width: 18px; border-radius: 18px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .35), 0 18px 30px -24px rgba(29, 27, 58, .8);
  padding: 26px 34px; overflow: hidden;
}
.board::after { /* tebeşir tozu izi */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .08;
  background-image: radial-gradient(#FFFFFF 1px, transparent 1.4px); background-size: 7px 9px;
}
.chalk-tray { height: 12px; margin: -4px 22px 0; background: var(--wood-dark); border-radius: 0 0 8px 8px; position: relative; z-index: 2; }
.chalk-tray::before { content: ""; position: absolute; left: 30px; top: -5px; width: 34px; height: 7px; border-radius: 4px; background: var(--chalk); }
.chalk-tray::after { content: ""; position: absolute; left: 80px; top: -6px; width: 46px; height: 10px; border-radius: 3px; background: #C9A27A; box-shadow: inset 0 -4px 0 #4B3A2A; }

.board-lines { position: relative; z-index: 1; font-family: 'Caveat', 'Kalam', cursive; color: var(--chalk); text-shadow: 0 0 1px rgba(255, 255, 255, .55), 0 0 6px rgba(255, 255, 255, .12); }
.board-lines .bl-title { font-size: 40px; font-weight: 700; margin: 0 0 6px; min-height: 52px; }
.board-lines .bl-line { font-size: 31px; font-weight: 600; line-height: 1.25; min-height: 44px; margin: 6px 0; }
.board-lines .bl-line .k { color: #FFE48A; }
.board-lines .bl-line .m { color: #9FE3C3; }
.board-lines .bl-line .p { color: #FFB4A2; }
.board-lines .underline { display: block; height: 3px; width: 0; background: var(--chalk); border-radius: 2px; opacity: .8; transition: width .6s ease; margin-top: 2px; }
.board-lines .underline.on { width: 220px; }
.caret { display: inline-block; width: 3px; height: 30px; margin-left: 3px; vertical-align: -4px; background: var(--chalk); border-radius: 2px; animation: kbBlink .9s steps(2) infinite; }
.board.erasing .board-lines { animation: kbErase .9s ease forwards; }
.eraser {
  position: absolute; z-index: 3; width: 74px; height: 30px; border-radius: 6px; left: -100px; top: 40%;
  background: linear-gradient(#C9A27A 0 60%, #4B3A2A 60% 100%); opacity: 0; pointer-events: none;
}
.board.erasing .eraser { animation: kbEraser .9s ease forwards; }

/* ---------- öğretmen (arkadan, tahtaya dönük) ---------- */
.teacher {
  position: absolute; z-index: 4; top: 120px; left: 62%; width: 393px; height: 600px;
  transition: left .55s cubic-bezier(.3, .7, .3, 1), top .55s cubic-bezier(.3, .7, .3, 1); pointer-events: none;
  filter: drop-shadow(0 14px 10px rgba(29, 27, 58, .18));
}
.teacher svg { width: 100%; height: 100%; overflow: visible; }
.teacher .arm-write { transform-origin: 150px 128px; transition: transform .3s ease; }
.teacher.writing .arm-write { animation: kbWrite .32s ease-in-out infinite alternate; }
.teacher .body-sway { transform-origin: 95px 300px; animation: kbSway 5s ease-in-out infinite; }
.teacher.walking .leg-l { animation: kbStep .5s ease-in-out infinite alternate; transform-origin: 80px 222px; }
.teacher.walking .leg-r { animation: kbStep .5s ease-in-out infinite alternate-reverse; transform-origin: 110px 222px; }
/* önde öğretmen masası: öğretmenin bacaklarını keser, sahneyi yere bağlar */
.desk {
  position: absolute; z-index: 6; left: -28px; right: -28px; bottom: 0; height: 110px;
  background: linear-gradient(#B98353 0 16px, #9A6B42 16px 22px, #8A5A35 22px 100%);
  border-radius: 20px 20px 0 0; box-shadow: 0 -10px 24px -18px rgba(29, 27, 58, .6);
}
.desk::after { content: ""; position: absolute; left: 6%; right: 6%; top: 46px; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .12); }
.desk .props { position: absolute; left: 7%; bottom: 100%; width: 210px; height: 66px; margin-bottom: -2px; }
.chalk-dust { position: absolute; z-index: 5; width: 5px; height: 5px; border-radius: 50%; background: var(--chalk); pointer-events: none; animation: kbDust .8s ease-out forwards; }

/* ---------- form tarafı ---------- */
.form-side { flex: 1 1 400px; min-width: 0; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.form-side .container {
  width: 100%; max-width: 440px; background: var(--bn-card); border-radius: 32px; padding: 40px 40px 34px;
  box-shadow: 0 30px 60px -40px rgba(29, 27, 58, .45); animation: kbFadeUp .6s cubic-bezier(.2, .8, .2, 1) both;
}
.form-side .header-logo { text-align: left !important; margin-bottom: 22px !important; }
.form-side .header-logo h2 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 34px; font-weight: 800; color: var(--bn-ink) !important; margin: 0 0 6px !important; }
.form-side .header-logo p { color: var(--bn-muted) !important; font-size: 15px !important; margin: 0 !important; }
.form-side h3 { font-family: 'Bricolage Grotesque', sans-serif; font-size: 26px; font-weight: 800; color: var(--bn-ink); margin: 0 0 14px; }
.form-side h4 { margin: 0 0 8px; font-size: 14px; }
.form-side p, .form-side label { color: var(--bn-muted); font-size: 14px; }
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--bn-ink) !important; margin: 0 0 8px; }

.form-side input[type="email"], .form-side input[type="password"], .form-side input[type="text"], .form-side textarea, .form-side select,
.modal-content input[type="password"] {
  width: 100%; height: 52px; padding: 0 16px; margin: 0 0 16px; border: 2px solid var(--bn-line); border-radius: 16px;
  background: #FAF9FF; color: var(--bn-ink); font: 15px 'Plus Jakarta Sans', sans-serif;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.form-side textarea { height: auto; padding: 12px 16px; }
.form-side input:focus, .form-side textarea:focus, .form-side select:focus, .modal-content input:focus {
  outline: none; border-color: var(--bn-accent); background: #FFFFFF; box-shadow: 0 0 0 4px rgba(91, 61, 245, .16);
}
.form-side button, .modal-content button {
  position: relative; overflow: hidden; width: 100%; height: 56px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--bn-accent); color: #FFFFFF; font: 800 17px 'Bricolage Grotesque', sans-serif;
  transition: transform .18s ease, box-shadow .18s ease, background-color .2s;
}
.form-side button:hover, .modal-content button:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(29, 27, 58, .55); }
.form-side button:active, .modal-content button:active { transform: translateY(1px) scale(.98); }
.form-side button::after, .modal-content button::after {
  content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%; background: rgba(255, 255, 255, .35);
  transform: translateX(-130%) skewX(-20deg); pointer-events: none;
}
.form-side button:hover::after, .modal-content button:hover::after { animation: kbShine .75s ease; }
.form-side button.btn-secondary { height: 46px; background: #FFFFFF; color: var(--bn-ink); border: 2px solid var(--bn-line); font: 700 15px 'Plus Jakarta Sans', sans-serif; margin-bottom: 14px; }
.form-side pre { background: #FAF9FF; border: 2px solid var(--bn-line); border-radius: 14px; padding: 14px; white-space: pre-wrap; word-break: break-all; font-size: 13px; }

/* masaüstü sekmeleri (Lisans / Giriş Yap / Kayıt Ol) */
.form-side .tab-container { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 5px; margin-bottom: 24px; background: var(--bn-soft); border-radius: 18px; border: 0; }
.form-side .tab-link { height: 44px !important; width: auto; margin: 0; background: transparent !important; color: var(--bn-muted) !important; border: 0 !important; border-radius: 14px; font: 700 14px 'Plus Jakarta Sans', sans-serif !important; box-shadow: none !important; }
.form-side .tab-link::after { display: none; }
.form-side .tab-link:hover { background: #FFFFFF !important; color: var(--bn-ink) !important; transform: none; }
.form-side .tab-link.active { background: var(--bn-ink) !important; color: #FFFFFF !important; }
.tab-content { display: none; }
.tab-content.active { display: block; animation: kbFadeUp .4s ease both; }
.form-side .radio-group { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.form-side .radio-label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: #FAF9FF; border: 2px solid var(--bn-line); cursor: pointer; margin: 0; }
.form-side .radio-label input { width: auto; height: auto; margin: 0; accent-color: var(--bn-accent); }
.form-side .radio-text { color: var(--bn-ink); font-weight: 600; }
.form-side .role-selection > label { display: block; font-weight: 700; color: var(--bn-ink); margin-bottom: 8px; }
#license-status { font-weight: 600; }

/* web: şifre yenileme penceresi (aynı id'ler) */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(29, 27, 58, .5); backdrop-filter: blur(5px); z-index: 1000; align-items: center; justify-content: center; }
.modal-content { background: #FFFFFF; padding: 34px; border-radius: 28px; width: 90%; max-width: 420px; text-align: center; animation: kbFadeUp .4s ease both; }
.modal-header h3 { font-family: 'Bricolage Grotesque', sans-serif; margin: 10px 0; color: var(--bn-ink); }
.modal-icon { font-size: 44px; display: block; }
.modal-body { margin-top: 20px; }
.error-text { color: #C0392B; font-size: 13px; min-height: 18px; margin-bottom: 10px; }

/* ---------- animasyonlar ---------- */
@keyframes kbFadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes kbShine { from { transform: translateX(-130%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
@keyframes kbBlink { 50% { opacity: 0; } }
@keyframes kbWrite { from { transform: rotate(-3deg) translateY(0); } to { transform: rotate(3deg) translateY(2px); } }
@keyframes kbSway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(.8deg); } }
@keyframes kbStep { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes kbDrift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, -14px); } }
@keyframes kbErase { to { opacity: 0; filter: blur(2px); } }
@keyframes kbEraser { 0% { left: -100px; opacity: 1; } 100% { left: 110%; opacity: 1; } }
@keyframes kbDust { from { opacity: .9; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx, 6px), 26px) scale(.4); } }

/* ---------- dar ekran ---------- */
@media (max-width: 900px) {
  .auth-wrap { padding: 14px; gap: 14px; }
  .board-side { min-height: 440px; padding: 18px 18px 0; }
  .board-lines .bl-title { font-size: 32px; }
  .board-lines .bl-line { font-size: 24px; }
  .teacher { width: 240px; height: 367px; }
  .desk { height: 76px; }
  .board { margin-bottom: 46px; }
  .form-side .container { padding: 30px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
