@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body.login-h5-app {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8f0f7;
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(34, 211, 238, 0.14), transparent 45%),
    radial-gradient(90% 60% at 100% 0%, rgba(45, 212, 191, 0.1), transparent 50%),
    linear-gradient(180deg, #070b12 0%, #0c1524 40%, #0a0f18 100%);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.login-h5-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(28px + env(safe-area-inset-bottom, 0px));
  max-width: 400px;
  margin: 0 auto;
  justify-content: center;
  gap: 22px;
}

.login-h5-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.login-h5-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, #22d3ee 0%, #0ea5e9 45%, #2dd4bf 100%);
  box-shadow:
    0 12px 32px rgba(34, 211, 238, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #042f2e;
  letter-spacing: -0.02em;
}

.login-h5-brand-text {
  flex: 1;
  min-width: 0;
}

.login-h5-brand-title {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: #ecfeff;
}

.login-h5-card {
  width: 100%;
  flex-shrink: 0;
  background: rgba(17, 27, 46, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 24px;
  padding: 26px 22px 24px;
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
}

.login-h5-card-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #f1f5f9;
}

.login-h5-card-desc {
  font-size: 14px;
  line-height: 1.55;
  color: #8da0b3;
  margin: 0 0 22px;
}

#login-message:empty {
  display: none;
}

#login-message:not(:empty) {
  margin-bottom: 12px;
}

.login-h5-app .form-group {
  margin-bottom: 16px;
}

.login-h5-app .label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.login-h5-app label {
  font-size: 13px;
  font-weight: 600;
  color: #94a8b8;
}

.login-h5-app input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  background: rgba(7, 11, 18, 0.55);
  color: #e8f0f7;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-h5-app input::placeholder {
  color: #6b7c8f;
}

.login-h5-app input:focus {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.login-h5-app .btn {
  width: 100%;
  padding: 15px 20px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.2s;
  touch-action: manipulation;
}

.login-h5-app .btn:active {
  transform: scale(0.98);
}

.login-h5-app .btn-primary {
  background: linear-gradient(135deg, #0891b2 0%, #0d9488 55%, #14b8a6 100%);
  color: #042f2e;
  box-shadow: 0 10px 28px rgba(8, 145, 178, 0.28);
}

.login-h5-app .btn-primary:hover {
  filter: brightness(1.05);
}

.login-h5-app .btn-secondary {
  background: rgba(23, 34, 54, 0.9);
  color: #e8f0f7;
  border: 1px solid rgba(45, 212, 191, 0.22);
}

.login-h5-app .btn:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.55);
  outline-offset: 2px;
}

.login-h5-app .alert {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.login-h5-app .alert-success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

.login-h5-app .alert-error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

.login-h5-app .alert-muted {
  background: rgba(23, 34, 54, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.18);
  color: #94a8b8;
}

/* 银行式：登录区一行勾选 + 协议链接；全文在弹层 */
.login-agreement-row {
  margin: 4px 0 18px;
}

.login-agreement-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.login-agreement-label input[type='checkbox'] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #0d9488;
  cursor: pointer;
}

.login-agreement-text {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  color: #94a8b8;
}

.license-open-link {
  display: inline;
  padding: 0;
  margin: 0 2px;
  border: none;
  background: none;
  color: #5eead4;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.license-open-link:active {
  opacity: 0.85;
}

.login-h5-app .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* 协议全文：底部半屏 / 居中面板，贴近银行 App */
.license-modal-root[hidden] {
  display: none !important;
}

.license-modal-root {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.license-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 18, 0.72);
  backdrop-filter: blur(4px);
}

.license-modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(88vh, 720px);
  background: #fafaf9;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(28, 25, 23, 0.08);
  animation: license-sheet-in 0.22s ease-out;
}

@keyframes license-sheet-in {
  from {
    transform: translateY(12px);
    opacity: 0.92;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.license-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #e7e5e4;
  flex-shrink: 0;
}

.license-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #1c1917;
}

.license-modal-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  color: #44403c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.license-modal-body.license-content {
  margin: 0;
  border-radius: 0;
  border: none;
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
}

.license-modal-root .license-content {
  padding: 14px 16px;
  white-space: pre-wrap;
  line-height: 1.75;
  color: #44403c;
  font-size: 13px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #f5f5f4;
}

.license-modal-footer {
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e7e5e4;
  flex-shrink: 0;
  background: #fafaf9;
}

.license-modal-footer .btn {
  width: 100%;
  color: #042f2e;
}

@media (min-width: 640px) {
  .license-modal-root {
    align-items: center;
    padding: 24px;
  }

  .license-modal-panel {
    border-radius: 20px;
    max-height: min(86vh, 760px);
  }
}

@media (max-width: 768px) {
  .login-agreement-text {
    font-size: 12px;
  }

  .license-modal-root .license-content {
    font-size: 12px;
  }
}

/* 矮屏或横屏：避免垂直居中把表单顶出可视区 */
@media (max-height: 560px) {
  .login-h5-shell {
    justify-content: flex-start;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
  }
}
