html, body {
  height: 100%;
  min-height: 100vh;
  width: 100vw;
  margin: 0;
  padding: 0;
  background: #f3f4f6;
  font-family: 'Inter', 'Roboto', Arial, sans-serif;
  overflow-x: hidden; 
  overflow-y: auto;     
}

.auth-wrapper {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-container {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  overflow-y: auto;     
  max-height: 90vh;    
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  box-sizing: border-box;
  margin: 10px 0 10px 0;
}

@media (max-width: 600px) {
  .auth-wrapper {
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    height: auto;
  }
  .auth-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 98vh;
    box-sizing: border-box;
  }
}

.auth-tabs {
  display: flex;
  background: #f7f7f7;
}
.auth-tabs .tab-btn {
  flex: 1;
  padding: 25px 0;
  border: none;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  color: #374151;
}
.auth-tabs .tab-btn:hover {
  background: #e5e7eb;
}
.auth-tabs .tab-btn.active {
  background: #ffffff;
  border-bottom: 3px solid #6366F1;
  color: #6366F1;
}

.auth-content > div {
  display: none;
  padding: 24px;
  opacity: 0;
  transition: opacity .35s cubic-bezier(.4,0,.2,1);
}
.auth-content > div.active {
  display: block;
  opacity: 1;
}

.auth-content label {
  display: block;
  font-size: 15px;
  color: #484e58;
  font-weight: 500;
}
.auth-content input[type="text"],
.auth-content input[type="email"] {
  width: 100%;
  padding: 14px 5px 14px 12px;
  margin-bottom: 18px;
  margin-top:8px;
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-content input[type="password"] {
  width: 100%;
  padding: 14px 12px;
  margin-bottom: 18px;
  margin-top:8px;
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-content input[type="text"]:focus,
.auth-content input[type="email"]:focus,
.auth-content input[type="password"]:focus {
  outline: none;
  border-color: #056546;
  background: #fff;
}
.auth-content input::placeholder {
  color: rgba(0, 0, 0, 0.35);
  font-style: italic;
}

.password-box {
  position: relative;
  margin-bottom: 18px;
}
.password-box input[type="password"],
.password-box input[type="text"] {
  width: 100%;
  padding: 14px 44px 14px 12px; /* right cho icon */
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  background: #fafbfc;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s;
  line-height: 1.4;
  height: 52px;
  display: block;
}
.password-box input:focus {
  border-color: #056546;
  background: #fff;
}

.toggle-pw {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.75;
  border-radius: 50%;
  background: none;
  border: none;
  z-index: 2;
  padding: 0;
  transition: background 0.18s, opacity 0.18s;
}
.toggle-pw:hover,
.toggle-pw.active,
.toggle-pw.showing {
  background: #f3f4f6;
  opacity: 1;
}
.toggle-pw svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
  display: block;
  transition: filter 0.15s, opacity 0.15s;
}
.toggle-pw .pw-cross {
  position: absolute;
  left: 8px;   
  right: 8px;
  top: 17px;   
  height: 2px;
  background: #64748b;
  border-radius: 2px;
  content: '';
  transform: rotate(-40deg); 
  opacity: 0.8;
  pointer-events: none;
  display: none;
}

.toggle-pw.showing svg { opacity: 0.5; filter: grayscale(1) brightness(0.65); }
.toggle-pw.showing .pw-cross { display: block; }
.toggle-pw .pw-cross { display: none; }

.auth-extra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1px 0 12px;
  font-size: 14px;
  color: #374151;
}
.auth-extra label {
  display: flex;
  align-items: center;
}
.auth-extra label input[type="checkbox"] {
  margin-right: 6px;
  vertical-align: middle;
  width: 16px;
  height: 16px;
}
.auth-extra a {
  color: #6366F1;
  text-decoration: none;
  font-size: 14px;
}
.auth-extra a:hover {
  text-decoration: underline;
}


/* ===== Nút Google Login ===== */
.google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 0;
  margin-top: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  color: #444;
  background: #ffffff;
  transition: background 0.2s, border-color 0.2s;
}
.google-login:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.google-login img {
  width: 20px;
  vertical-align: middle;
  margin-right: 8px;
}

.form-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #fff4f2;
  color: #e25838;
  border: 1.5px solid #ff8872;
  border-radius: 6px;
  padding: 12px 18px;
  margin: 12px 0 14px 0;
  font-size: 0.81rem;
  box-shadow: 0 2px 14px rgba(238,84,54,0.08);
  opacity: 1;
  transform: translateY(0) scale(1);
  max-height: 90px;
  transition:
    opacity 0.54s cubic-bezier(.47,1.64,.41,.8),
    transform 0.45s cubic-bezier(.25,.8,.25,1),
    max-height 0.62s cubic-bezier(.52,.01,.27,1),
    padding 0.32s cubic-bezier(.52,.01,.27,1),
    margin 0.28s cubic-bezier(.52,.01,.27,1),
    box-shadow 0.38s;
  overflow: hidden;
  will-change: opacity, transform, max-height, padding, margin, box-shadow;
}

.form-error.hide {
  opacity: 0;
  transform: translateY(-18px) scale(.94);
  max-height: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  margin-top: 0 !important;
  box-shadow: 0 0px 4px rgba(238,84,54,0.03);
  pointer-events: none;
}
.success {
  color: #059669;
  font-size: 14px;
  margin-bottom: 16px;
}

small.form-hint {
  display: block;
  margin: 0 0 24px 0;   /* 8px trên, 24px dưới */
  font-size: 0.85rem;
  line-height: 1.4;
  color: #6b7280;
}

.toggle-pw {
  /* Không cho phép chọn text khi click */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}


/* Gộp chung các input type */
.auth-content input[type="text"],
.auth-content input[type="email"],
.auth-content input[type="tel"],
.auth-content input[type="password"] {
  width: 100%;
  padding: 14px 5px 14px 12px;
  margin-bottom: 18px;
  margin-top: 8px;
  border: 1px solid #e1e1e1;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-content input[type="text"]:focus,
.auth-content input[type="email"]:focus,
.auth-content input[type="tel"]:focus,
.auth-content input[type="password"]:focus {
  outline: none;
  border-color: #056546;
  background: #fff;
}

.auth-content input[type="text"]::placeholder,
.auth-content input[type="email"]::placeholder,
.auth-content input[type="tel"]::placeholder,
.auth-content input[type="password"]::placeholder {
  color: rgba(0, 0, 0, 0.35);
  font-style: italic;
}