/* 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 Auth Stylesheet
   Dùng chung cho: student-login, student-register, student-forgot-password
   Desktop: khung 580px giữa màn hình, nền #EAFBFF
   Mobile: full màn hình, không border-radius
   ============================================================ */

/* ---------- 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: #ffffff;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* ---------- AUTH CONTAINER (khung chính) ---------- */
.auth-container {
  width: 580px;
  min-height: 100dvh;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- AUTH HEADER ---------- */
.auth-header {
  text-align: center;
  padding: 40px 24px 8px;
  flex-shrink: 0;
}

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

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

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

.auth-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0c4a6e;
  margin-top: 16px;
}

.auth-description {
  font-size: 0.875rem;
  color: #64748b;
  margin-top: 8px;
  line-height: 1.5;
}

/* ---------- AUTH BODY ---------- */
.auth-body {
  flex: 1;
  padding: 8px 28px 28px;
  display: flex;
  flex-direction: column;
}

/* ---------- FORM WRAPPER ---------- */
.auth-form {
  width: 300px;
  max-width: calc(100% - 40px);
  margin: 24px auto 0;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 16px;
}

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

/* ---------- INPUT ---------- */
.auth-form .form-group input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 2px solid #17345D;
  border-radius: 14px;
  background: #ffffff;
  font-size: 1rem;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 0 #17345D;
  box-sizing: border-box;
}

.auth-form .form-group input:focus {
  border-color: #2F80ED;
  box-shadow: 0 4px 0 #17345D, 0 0 0 3px rgba(47, 128, 237, 0.12);
}

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

/* ---------- PASSWORD WRAPPER ---------- */
.auth-form .password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

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

.auth-form .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;
}

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

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

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

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

/* ---------- BUTTONS ---------- */
.auth-form .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  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;
}

/* Nút chính */
.auth-form .btn-primary {
  background: #2F80ED;
  color: #ffffff;
  box-shadow: 0 4px 0 #0756A6;
  margin-top: 8px;
}

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

.auth-form .btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0756A6;
}

/* Nút phụ */
.auth-form .btn-secondary {
  background: #ffffff;
  color: #2F80ED;
  border: 2px solid #2F80ED;
  box-shadow: 0 4px 0 #0756A6;
}

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

.auth-form .btn-secondary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0756A6;
}

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

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

/* ---------- BACK LINK ---------- */
.auth-form .back-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  color: #2F80ED;
  text-decoration: none;
  font-weight: 600;
}

.auth-form .back-link:hover {
  color: #0C5EB8;
  text-decoration: underline;
}

/* ---------- ALERTS ---------- */
.auth-form .alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 16px;
  width: 100%;
}

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

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

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

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

/* 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;
}

.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;
}

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

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

.bird-body {
  position: relative;
  width: 44px;
  height: 44px;
  background: #F5A623;
  border-radius: 50%;
}

.bird-body::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 8px;
  background: #E5941E;
  border-radius: 50%;
}

.bird-eye {
  position: absolute;
  top: 12px;
  width: 10px;
  height: 12px;
  background: #ffffff;
  border-radius: 50%;
}

.bird-eye.left {
  left: 10px;
}

.bird-eye.right {
  right: 10px;
}

.bird-eye::after {
  content: "";
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 7px;
  background: #1e293b;
  border-radius: 50%;
}

.bird-beak {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #E88C10;
}

.bird-wing {
  position: absolute;
  top: 14px;
  width: 14px;
  height: 18px;
  background: #D4891A;
  border-radius: 50%;
}

.bird-wing.left {
  left: -5px;
  transform: rotate(15deg);
}

.bird-wing.right {
  right: -5px;
  transform: rotate(-15deg);
}

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

  .auth-container {
    width: 100%;
    min-height: 100dvh;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
  }

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

  .auth-body {
    padding: 8px 24px 24px;
  }

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

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

  .mascot-bird {
    bottom: 22px;
    right: 20px;
  }

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

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

  .auth-logo {
    font-size: 1.7rem;
  }

  .auth-body {
    padding: 8px 20px 20px;
  }

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

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

  @keyframes bird-bounce-sm {
    0%, 100% { transform: scale(0.85) translateY(0); }
    50% { transform: scale(0.85) 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;
  }
}