/* EnglishSpeak — normalize text size in Android in-app browsers (Zalo, etc.) */
html {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

/* ============================================================
   EnglishSpeak — Student Stylesheet
   Modern, clean design — Desktop + Mobile responsive.
   ============================================================ */

/* ---------- RESET ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #1e293b;
  background: #EAFBFF;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
}

/* ---------- BACKGROUND CLOUDS ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 120px 50px at 12% 14%, rgba(255,255,255,0.9) 0%, transparent 70%),
    radial-gradient(ellipse 90px 40px at 20% 11%, rgba(255,255,255,0.85) 0%, transparent 70%),
    radial-gradient(ellipse 100px 45px at 25% 16%, rgba(255,255,255,0.88) 0%, transparent 70%),
    radial-gradient(ellipse 140px 55px at 70% 10%, rgba(255,255,255,0.85) 0%, transparent 70%),
    radial-gradient(ellipse 100px 40px at 78% 8%, rgba(255,255,255,0.8) 0%, transparent 70%),
    radial-gradient(ellipse 110px 48px at 84% 12%, rgba(255,255,255,0.83) 0%, transparent 70%),
    radial-gradient(ellipse 100px 42px at 48% 22%, rgba(255,255,255,0.7) 0%, transparent 70%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.85;
}

/* ---------- APPLICATION PANEL ---------- */
.app-panel {
  position: relative;
  z-index: 1;
  width: min(680px, calc(100vw - 32px));
  height: calc(100dvh - 20px);
  height: calc(100vh - 20px);
  margin: 10px auto;
  border-radius: 24px;
  overflow: hidden;
  background: #DFF9FC;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

/* ---------- PANEL HEADER ---------- */
.panel-header {
  text-align: center;
  padding: 28px 24px 12px;
  flex-shrink: 0;
}

.panel-header .logo {
  font-size: 2rem;
  font-weight: 800;
  color: #0c4a6e;
  letter-spacing: -0.5px;
}

.panel-header .logo .accent {
  color: #0284c7;
}

.panel-header .subtitle {
  font-size: 0.9rem;
  color: #475569;
  margin-top: 4px;
}

/* ---------- PANEL BODY ---------- */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- LOGIN FORM INNER WRAPPER ---------- */
.login-form-inner {
  width: 300px;
  max-width: calc(100% - 48px);
  margin: 0 auto;
}

.login-form-inner .form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 14px;
}

.login-form-inner .form-group label {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
}

.login-form-inner .form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #112A55;
  border-radius: 14px;
  background: #ffffff;
  font-size: 1rem;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 5px 0 #112A55;
}

.login-form-inner .form-group input:focus {
  border-color: #2F80ED;
  box-shadow: 0 5px 0 #112A55, 0 0 0 3px rgba(47, 128, 237, 0.12);
}

.login-form-inner .form-group input::placeholder {
  color: #AEB7C4;
}

/* password wrapper inside login-form-inner */
.login-form-inner .password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-form-inner .password-wrapper input {
  padding-right: 52px;
}

.login-form-inner .password-wrapper .toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.login-form-inner .password-wrapper .toggle-password:hover {
  color: #2F80ED;
  background: rgba(47, 128, 237, 0.08);
}

.login-form-inner .password-wrapper .toggle-password .eye-icon {
  display: block;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
}

.login-form-inner .btn-primary {
  background: #2F80ED;
  color: #ffffff;
  box-shadow: 0 5px 0 #0C5EB8;
  width: 100%;
  display: block;
  margin-left: 0;
  margin-right: 0;
  margin-top: 8px;
}

.login-form-inner .btn-primary:hover {
  background: #4A90F0;
}

.login-form-inner .btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #0C5EB8;
}

.login-form-inner .btn-secondary {
  background: #ffffff;
  color: #2F80ED;
  border: 2px solid #2F80ED;
  box-shadow: 0 5px 0 rgba(47, 128, 237, 0.25);
  width: 100%;
  display: block;
  margin-left: 0;
  margin-right: 0;
}

.login-form-inner .btn-secondary:hover {
  background: #f0f7ff;
}

.login-form-inner .btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(47, 128, 237, 0.25);
}

.btn-danger {
  background: #ffffff;
  color: #dc2626;
  border: 2px solid #fecaca;
}

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

.btn-link {
  background: none;
  color: #0284c7;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 0;
  width: auto;
}

.btn-link:hover {
  color: #075985;
  text-decoration: underline;
}

.btn-back {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.95);
}

/* ---------- FORGOT LINK ---------- */
.login-form-inner .forgot-link {
  display: block;
  width: 100%;
  margin: 12px 0 20px;
  text-align: right;
  font-size: 0.85rem;
  color: #2F80ED;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s, text-decoration 0.15s;
}

.login-form-inner .forgot-link:hover {
  color: #0C5EB8;
  text-decoration: underline;
}

/* ---------- FORM DIVIDER ---------- */
.login-form-inner .form-divider {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  color: #94a3b8;
  font-size: 0.8rem;
  margin: 16px 0;
}

.login-form-inner .form-divider::before,
.login-form-inner .form-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d1d5db;
}

/* ---------- ERROR / SUCCESS MESSAGES ---------- */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  flex-shrink: 0;
}

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

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

/* ---------- PANEL ILLUSTRATION ---------- */
.panel-illustration {
  flex-shrink: 0;
  height: 180px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #DFF9FC 0%, #E8F8FF 40%, #C5F0D0 70%, #A8E6A0 100%);
}

.illustration-scene {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Scene clouds */
.scene-cloud {
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.9;
}

.cloud-1 {
  width: 90px;
  height: 36px;
  top: 8px;
  left: 10%;
  box-shadow:
    28px -10px 0 12px #ffffff,
    55px -6px 0 8px #ffffff,
    -20px -4px 0 10px #ffffff;
}

.cloud-2 {
  width: 70px;
  height: 28px;
  top: 20px;
  right: 15%;
  box-shadow:
    22px -8px 0 10px #ffffff,
    45px -5px 0 6px #ffffff;
}

.cloud-3 {
  width: 60px;
  height: 24px;
  top: 6px;
  left: 55%;
  box-shadow:
    18px -7px 0 8px #ffffff,
    -15px -3px 0 8px #ffffff;
}

/* Mountains */
.scene-mountain {
  position: absolute;
  bottom: 36px;
  width: 0;
  height: 0;
}

.mountain-1 {
  left: -5%;
  border-left: 160px solid transparent;
  border-right: 120px solid transparent;
  border-bottom: 130px solid #7EC8A0;
}

.mountain-2 {
  right: -10px;
  border-left: 180px solid transparent;
  border-right: 80px solid transparent;
  border-bottom: 110px solid #5BA37A;
}

/* Ground */
.scene-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: linear-gradient(180deg, #8DD4A0 0%, #6BBF80 100%);
  border-radius: 50% 60% 0 0 / 20px 20px 0 0;
}

/* Trees */
.scene-tree {
  position: absolute;
  bottom: 32px;
}

.tree-1 {
  left: 5%;
}

.tree-2 {
  left: 18%;
}

.tree-3 {
  right: 8%;
}

.scene-tree::before {
  content: "";
  display: block;
  width: 12px;
  height: 28px;
  background: #8B6914;
  border-radius: 2px;
  margin: 0 auto;
}

.scene-tree::after {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  background: #4A9B6A;
  border-radius: 50%;
  margin: -8px auto 0;
  box-shadow: 0 0 0 4px #3D8B5F;
}

/* ---------- MASCOT OWL ---------- */
.mascot-owl {
  position: absolute;
  bottom: 28px;
  right: 25px;
  z-index: 2;
  animation: owl-bounce 3s ease-in-out infinite;
}

@keyframes owl-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.owl-body {
  position: relative;
  width: 50px;
  height: 52px;
  background: #F5A623;
  border-radius: 50% 50% 45% 45%;
}

/* Ears */
.owl-ear-left,
.owl-ear-right {
  position: absolute;
  top: -10px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 16px solid #E5941E;
}

.owl-ear-left {
  left: 2px;
  transform: rotate(-15deg);
}

.owl-ear-right {
  right: 2px;
  transform: rotate(15deg);
}

/* Face */
.owl-face {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 32px;
  background: #FFF8E7;
  border-radius: 50%;
}

/* Eyes */
.owl-eye {
  position: absolute;
  top: 6px;
  width: 12px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  overflow: hidden;
}

.owl-eye.left {
  left: 6px;
}

.owl-eye.right {
  right: 6px;
}

.owl-pupil {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 8px;
  background: #1e293b;
  border-radius: 50%;
}

.owl-pupil::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 3px;
  height: 3px;
  background: #ffffff;
  border-radius: 50%;
}

/* Beak */
.owl-beak {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #E88C10;
}

/* Wings */
.owl-wing {
  position: absolute;
  top: 16px;
  width: 14px;
  height: 22px;
  background: #D4891A;
  border-radius: 50%;
}

.owl-wing.left {
  left: -6px;
  transform: rotate(15deg);
}

.owl-wing.right {
  right: -6px;
  transform: rotate(-15deg);
}

/* Feet */
.owl-feet {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.owl-foot {
  width: 10px;
  height: 10px;
  background: #E88C10;
  border-radius: 50% 50% 30% 30%;
}

/* ---------- HOME PAGE ---------- */
.home-greeting {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0c4a6e;
  text-align: center;
  margin-bottom: 4px;
}

.home-greeting span {
  color: #0284c7;
}

.home-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  text-align: center;
  margin-bottom: 12px;
}

/* course cards */
.course-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.course-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.course-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.course-icon.global-success {
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1d4ed8;
}

.course-icon.everybody-up {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #b45309;
}

.course-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}

.course-info p {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 2px;
}

/* ---------- MOBILE (<=768px) ---------- */
@media (max-width: 768px) {
  body {
    background: #EAFBFF;
    align-items: flex-start;
  }

  body::before {
    opacity: 0.6;
  }

  .app-panel {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: #EAFBFF;
  }

  .panel-header {
    padding-top: 40px;
  }

  .panel-body {
    padding: 12px 24px 24px;
  }

  .login-form-inner {
    width: 100%;
    max-width: none;
  }

  .btn-back {
    top: 12px;
    left: 12px;
  }

  .panel-illustration {
    height: auto;
    flex: 1;
    min-height: 160px;
    max-height: 260px;
  }

  .mascot-owl {
    bottom: 22px;
    right: 20px;
    transform: scale(0.85);
    animation: owl-bounce-mobile 3s ease-in-out infinite;
  }

  @keyframes owl-bounce-mobile {
    0%, 100% { transform: scale(0.85) translateY(0); }
    50% { transform: scale(0.85) translateY(-5px); }
  }

  .tree-1 { left: 3%; }
  .tree-2 { left: 16%; }
  .tree-3 { right: 6%; }
}

/* Small phones 360-430px */
@media (max-width: 430px) {
  .panel-header {
    padding-top: 32px;
    padding-bottom: 6px;
  }

  .panel-header .logo {
    font-size: 1.7rem;
  }

  .panel-body {
    padding: 10px 20px 20px;
  }

  .panel-illustration {
    min-height: 140px;
    max-height: 200px;
  }

  .mascot-owl {
    bottom: 18px;
    right: 16px;
    transform: scale(0.7);
    animation: owl-bounce-sm 3s ease-in-out infinite;
  }

  @keyframes owl-bounce-sm {
    0%, 100% { transform: scale(0.7) translateY(0); }
    50% { transform: scale(0.7) translateY(-4px); }
  }

  .scene-cloud {
    opacity: 0.7;
  }

  .mountain-1 {
    border-left-width: 120px;
    border-right-width: 90px;
    border-bottom-width: 100px;
  }

  .mountain-2 {
    border-left-width: 140px;
    border-right-width: 60px;
    border-bottom-width: 85px;
  }
}