/* ===== Global Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0b0e11;
  color: #eaecef;
}
#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ===== Login Page ===== */
#loginPage {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 30%, #1a1f2e 0%, #0b0e11 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, transform 0.6s ease;
  overflow: visible;
}
#loginPage.hide {
  opacity: 0;
  transform: none;
  pointer-events: none;
}
.login-logo {
  width: 90px;
  height: 90px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f0b90b, #f8d12f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 900;
  color: #0b0e11;
  margin-bottom: 24px;
  box-shadow: 0 12px 40px rgba(240, 185, 11, 0.35);
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.login-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-shadow: 0 0 1px rgba(160,160,160,0.9), 0 0 2px rgba(160,160,160,0.7);
}
.login-title .lt-super {
  color: #bcb38e;
}
.login-title .lt-highlight {
  color: #a8903e;
}
.login-title .lt-dim {
  color: #bcb38e;
}
.login-sub {
  font-size: 13px;
  color: #848e9c;
  margin-bottom: 48px;
}
.auth-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* ===== Auth Buttons ===== */
.auth-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.auth-btn {
  position: relative;
  width: 220px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 26px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  overflow: hidden;
  transform: scale(1);
  will-change: transform;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.32s ease,
              box-shadow 0.32s ease,
              background 0.32s ease;
  -webkit-tap-highlight-color: transparent;

  
}

.auth-btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0.55;
  pointer-events: none;
  animation: authRipple 0.55s ease-out forwards;
}
@keyframes authRipple {
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

.auth-btn.tap {
  transform: scale(1.03);
  transform-origin: center center;
}
.auth-btn-login {
  background: linear-gradient(135deg, #f5c26b, #e8b45c);
  color: #1a1f2e;
  box-shadow: 0 8px 24px rgba(245, 194, 107, 0.35);
}
.auth-btn-login .ripple {
  background: rgba(26, 31, 46, 0.35);
}
.auth-btn-login.tap {
  background: linear-gradient(135deg, #ffd27e, #f5c26b);
  box-shadow: 0 10px 30px rgba(245, 194, 107, 0.5);
}

.auth-btn-register {
  background: #1f252b;
  color: #f5c26b;
  border: 1px solid rgba(245, 194, 107, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.auth-btn-register .ripple {
  background: rgba(245, 194, 107, 0.45);
}
.auth-btn-register.tap {
  background: #2a3138;
  box-shadow: 0 10px 30px rgba(245, 194, 107, 0.25);
}

/* ===== Main Page Container ===== */
#mainPage {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
#mainPage.show {
  display: flex;
  animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.page-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  will-change: opacity, transform;
}
.page.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.page::-webkit-scrollbar { width: 0; }

/* ===== Tab Bar ===== */
.tabbar {
  display: flex;
  height: 56px;
  background: #161a1e;
  border-top: 1px solid #262b31;
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #848e9c;
  font-size: 11px;
  gap: 2px;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.15s ease;
}
.tab-item:active { transform: scale(0.9); }
.tab-item.active { color: #c4a35a; }
.tab-icon { font-size: 20px; }

/* ===== Register Modal ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-mask.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  background: #161a1e;
  border: 1px solid #262b31;
  border-radius: 16px;
  padding: 22px 20px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-close-top {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #848e9c;
  font-size: 16px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}
.modal-close-top:active {
  background: #1f252b;
  color: #eaecef;
}
.modal-mask.show .modal-card {
  transform: translateY(0) scale(1);
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #eaecef;
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.field {
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-size: 13px;
  color: #eaecef;
  margin-bottom: 6px;
}
.field-tip {
  display: block;
  font-size: 11px;
  color: #848e9c;
  margin-top: 3px;
  font-weight: 400;
  line-height: 1.4;
}
.field-input {
  width: 100%;
  height: 42px;
  background: #0b0e11;
  border: 1px solid #262b31;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: #eaecef;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field-input::placeholder {
  color: #474d57;
}
.field-input:focus {
  border-color: rgba(245, 194, 107, 0.6);
  box-shadow: 0 0 0 2px rgba(245, 194, 107, 0.12);
}
.field-input.error {
  border-color: #f6465d;
  box-shadow: 0 0 0 2px rgba(246, 70, 93, 0.15);
}
.field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.field-row .field-input {
  flex: 1;
  min-width: 0;
}
.verify-btn {
  flex-shrink: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(245, 194, 107, 0.45);
  background: #1f252b;
  color: #f5c26b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.verify-btn:active {
  background: #262d34;
}
.verify-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.modal-submit {
  width: 100%;
  margin-top: 8px;
}
.modal-close {
  width: 100%;
  height: 40px;
  margin-top: 8px;
  border: none;
  background: transparent;
  color: #848e9c;
  font-size: 14px;
  cursor: pointer;
  border-radius: 10px;
}
.modal-close:active {
  background: #1f252b;
}
.modal-close:active {
  background: #1f252b;
}

/* ===== Forgot Password ===== */
.forgot-pwd-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  margin-bottom: 20px;
}
.forgot-pwd-btn {
  font-size: 12px;
  color: #848e9c;
  cursor: pointer;
  transition: color 0.2s ease;
}
.forgot-pwd-btn:active {
  color: #f5c26b;
}
/* ===== Modal Divider ===== */
.modal-divider {
  width: 100%;
  height: 1px;
  background: #262b31;
  margin: 16px 0;
}

