/* Components Styles - Reusable UI Components */

/* ==================== Input Components ==================== */
:root {
  /* 添加红色相关变量 */
  --secondary-colors-red-100: #d62b18;
  --secondary-colors-red-60: #dd6b5e;
  --secondary-colors-red-hover: #b93a2c;
}
/* Verification Code Input */
.code-input {
  width: 64px;
  max-width: 64px;
  height: 64px;
  padding: 2px 8px;
  background: var(--colors-base-white, #ffffff);
  border: 1px solid var(--primary-colors-brand-grey-40, #e5e6e6);
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
  font-family: var(--display-lg-font-family, 'Inter', sans-serif);
  font-size: var(--display-lg-font-size, 48px);
  font-weight: var(--display-lg-font-weight, 500);
  line-height: var(--display-lg-line-height, 60px);
  text-align: center;
  color: var(--primary-colors-primary-grey-100, #3e3a39);
  outline: none;
  transition: border-color 0.3s ease;
}

.code-input::placeholder {
  color: var(--primary-colors-primary-grey-40, #b2b0b0);
}

.code-input:focus {
  border-color: var(--primary-colors-primary-blue-100, #004077);
}

.code-input:disabled {
  background: var(--primary-colors-brand-grey-20, #f2f2f2);
  cursor: not-allowed;
}

/* Floating Label Input */
.input-container {
  position: relative;
  margin-bottom: 8px;
  display: inline-block;
  width: 100%;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  border: 1px solid var(--primary-colors-primary-grey-40, #b2b0b0);
  border-radius: 8px;
  background: var(--colors-base-white, #ffffff);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}
.form-field {
    width: 384px;
}
.form-field > .input-container > .input-wrapper > label.error.has-error.has-error-msg:not([style*="display: none"]) {
  position: absolute;
  left: 0;
  bottom: -18px;
  font-family: var(--font-family);
  font-weight: var(--en-text-sm-font-weight, 500);
  font-size: var(--en-text-sm-font-size, 11px);
  line-height: var(--en-text-sm-line-height, 18px);
  color: var(--secondary-colors-red-100, #d62b18);
}
.form-field > .input-container > label.error.has-error.has-error-msg:not([style*="display: none"]) {
  font-family: var(--font-family);
  font-weight: var(--en-text-sm-font-weight, 500);
  font-size: var(--en-text-sm-font-size, 11px);
  line-height: var(--en-text-sm-line-height, 18px);
  color: var(--secondary-colors-red-100, #d62b18);
}

.input-wrapper:focus-within {
  border-color: var(--primary-colors-primary-blue-100, #004077);
  border-width: 2px;
}

.input-container:has(>label.error.has-error.has-error-msg:not([style*="display: none"])) > .input-wrapper,
.input-wrapper:has(>label.error.has-error.has-error-msg:not([style*="display: none"])) {
  border-color: var(--secondary-colors-red-60, #dd6b5e);
}

.input-container:has(>label.error.has-error.has-error-msg:not([style*="display: none"])) > .input-wrapper:focus-within,
.input-wrapper:has(>label.error.has-error.has-error-msg:not([style*="display: none"])):focus-within {
  border-color: var(--secondary-colors-red-hover, #b93a2c);
  border-width: 2px;
}

.input-wrapper.disabled {
  background: var(--primary-colors-brand-grey-20, #f2f2f2);
  border-color: var(--primary-colors-primary-grey-40, #b2b0b0);
  cursor: not-allowed;
}

.input-wrapper.disabled .input-field {
  cursor: not-allowed;
}

.input-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.input-slot.start {
  position: absolute;
  left: 0;
  margin-right: 8px;
  margin-left: 12px;
}

.input-slot.end {
  position: absolute;
  right: 0;
  margin-left: 8px;
  margin-right: 12px;
}
.input-slot.end:has(.captcha-img) {
  width: 100px;
  margin-right: 4px;
}

.input-field {
  flex: 1;
  height: 100%;
  border: none;
  outline: none;
  font-family: var(--font-family);
  font-weight: var(--en-text-sm-font-weight, 500);
  font-size: var(--en-text-sm-font-size, 11px);
  line-height: var(--en-text-sm-line-height, 18px);
  color: var(--primary-colors-primary-grey-100, #3e3a39);
  background: transparent;
  min-width: 60px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
}
.input-wrapper:has(.input-slot.start) > .input-field {
  padding-left: calc(12px + 12px + 16px);
}
.input-wrapper:has(.input-slot.end) > .input-field {
  padding-right: calc(12px + 12px + 16px);
}
select.input-field {
  /* Chrome、Safari、Edge 等 WebKit 内核浏览器 */
  -webkit-appearance: none;
  /* Firefox 浏览器 */
  -moz-appearance: none;
  /* 标准属性（现代浏览器通用） */
  appearance: none;
  /* 清除 IE 浏览器的默认下拉箭头 */
  background-image: none;
}
/* 清除 Firefox 特有的默认箭头 */
select.input-field::-ms-expand {
  display: none;
}

.input-field::placeholder {
  color: var(--primary-colors-primary-grey-40, #b2b0b0);
}

/* Browser autofill (Chrome/Edge) doesn't trigger our "has-value" class by itself.
   Use an animation hook so JS can re-sync label state immediately. */
@keyframes paasAutofillStart { from { } to { } }
@keyframes paasAutofillCancel { from { } to { } }

.input-field:-webkit-autofill {
  animation-name: paasAutofillStart;
  animation-duration: 0.01s;
}

.input-field:not(:-webkit-autofill) {
  animation-name: paasAutofillCancel;
  animation-duration: 0.01s;
}

.input-wrapper.disabled .input-field {
  color: var(--primary-colors-primary-grey-60, #8b8988);
}

.label-wrapper {
  position: absolute;
  top: 20px;
  left: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  height: 4px;
  background: var(--colors-base-white, #ffffff);
  transform: translateY(-50%);
  opacity: .8;
  transition: all 0.2s ease;
  pointer-events: none;
}

.input-wrapper:has(.input-slot.start) .label-wrapper {
  left: 30px;
}

.asterisk {
  font-family: var(--font-family);
  font-weight: var(--en-text-sm-font-weight, 500);
  font-size: var(--en-text-sm-font-size, 11px);
  line-height: var(--en-text-sm-line-height, 18px);
  color: var(--secondary-colors-red-100, #d62b18);
}

.label-text {
  font-family: var(--font-family);
  font-weight: var(--en-text-sm-font-weight, 500);
  font-size: var(--en-text-sm-font-size, 11px);
  line-height: var(--en-text-sm-line-height, 18px);
  color: var(--primary-colors-primary-grey-40, #B2B0B0);
}

.input-wrapper.has-value .label-wrapper,
.input-wrapper:focus-within .label-wrapper {
  opacity: 1;
  top: 0;
  left: 12px;
}

.input-wrapper:has(.input-field:is(:-webkit-autofill, :autofill)) .label-wrapper {
  top: 0;
  left: 12px;
}

.input-wrapper.error .label-wrapper {
  background: var(--colors-base-white, #ffffff);
}

.input-wrapper.disabled .label-wrapper {
  background: var(--primary-colors-brand-grey-20, #f2f2f2);
}

.input-hint {
  margin-top: 6px;
  font-family: var(--en-text-xs-font-family, 'Inter', sans-serif);
  font-weight: var(--en-text-xs-font-weight, 500);
  font-size: var(--en-text-xs-font-size, 10px);
  line-height: var(--en-text-xs-line-height, 14px);
  color: var(--primary-colors-primary-grey-60, #8b8988);
  text-align: left;
  position: relative;
  align-self: stretch;
}

.input-error {
  margin-top: 6px;
  font-family: var(--en-text-xs-font-family, 'Inter', sans-serif);
  font-weight: var(--en-text-xs-font-weight, 500);
  font-size: var(--en-text-xs-font-size, 10px);
  line-height: var(--en-text-xs-line-height, 14px);
  color: var(--secondary-colors-red-100, #d62b18);
}

.icon-svg {
  width: 16px;
  height: 16px;
}

.icon-mail {
  fill: var(--primary-colors-primary-grey-80, #656161);
}

.icon-alert {
  fill: var(--secondary-colors-red-100, #d62b18);
}

.icon-help {
  fill: var(--primary-colors-primary-grey-100, #3e3a39);
}

.password-toggle {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
}

.input-wrapper.disabled .icon-mail {
  fill: var(--primary-colors-primary-grey-40, #b2b0b0);
}

.input-wrapper.disabled .icon-help {
  fill: var(--primary-colors-brand-grey-100, #bfc0c0);
}
/* 修复在iPhone上的密码框会出现字体问题 */
input[type=password] {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}


/* ==================== Text Components ==================== */

/* Normal Text */
.text-normal {
  color: var(--primary-colors-primary-grey-100, #3e3a39);
  font-family: var(--en-text-xs-font-family, 'Inter', sans-serif);
  font-weight: var(--en-text-xs-font-weight, 500);
}

/* Hint Text */
.text-hint {
  font-family: var(--en-text-xs-font-family, 'Inter', sans-serif);
  font-size: var(--en-text-xs-font-size, 10px);
  font-weight: var(--en-text-xs-font-weight, 500);
  line-height: var(--en-text-xs-line-height, 14px);
  color: var(--primary-colors-brand-grey-80, #cccdcd);
}

/* ==================== Input Group Components ==================== */
::-ms-reveal {
  display: none;
}

/* Verification Code Inputs Container */
.verification-code-inputs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  justify-content: center;
}


/* ==================== Button Components ==================== */


/* Button Base Styles */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border: none;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.75;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

/* Primary Button - Blue */
.btn-primary {
  background-color: #004077;
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: #003366;
}

.btn-primary:active {
  background-color: #002952;
}

.btn-primary:disabled {
  background-color: #E5E6E6;
  color: #8B8988;
  cursor: not-allowed;
}

/* Secondary Button - White with Blue Border */
.btn-secondary {
  background-color: #FFFFFF;
  color: #004077;
  border: 1px solid #004077;
}

.btn-secondary:hover {
  background-color: #F2F2F2;
}

.btn-secondary:active {
  background-color: #E5E6E6;
}

.btn-secondary:disabled {
  background-color: #FFFFFF;
  border-color: #E5E6E6;
  color: #8B8988;
  cursor: not-allowed;
}

/* Outline Button - Transparent with Border */
.btn-outline {
  background-color: transparent;
  color: #004077;
  border: 1px solid #004077;
}

.btn-outline:hover {
  background-color: rgba(0, 64, 119, 0.05);
}

.btn-outline:active {
  background-color: rgba(0, 64, 119, 0.1);
}

.btn-outline:disabled {
  border-color: #E5E6E6;
  color: #8B8988;
  cursor: not-allowed;
}

/* Ghost Button - No Background/Border */
.btn-ghost {
  background-color: transparent;
  color: #004077;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background-color: rgba(0, 64, 119, 0.05);
}

.btn-ghost:active {
  background-color: rgba(0, 64, 119, 0.1);
}

.btn-ghost:disabled {
  color: #8B8988;
  cursor: not-allowed;
}

/* Text Button - Text Only */
.btn-text {
  background-color: transparent;
  color: #004077;
  border: none;
  padding: 8px 16px;
}

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

.btn-text:active {
  color: #002952;
}

.btn-text:disabled {
  color: #8B8988;
  cursor: not-allowed;
  text-decoration: none;
}

/* Danger Button - Red */
.btn-danger {
  background-color: #DC2626;
  color: #FFFFFF;
}

.btn-danger:hover {
  background-color: #B91C1C;
}

.btn-danger:active {
  background-color: #991B1B;
}

.btn-danger:disabled {
  background-color: #E5E6E6;
  color: #8B8988;
  cursor: not-allowed;
}

/* Success Button - Green */
.btn-success {
  background-color: #549B35;
  color: #FFFFFF;
}

.btn-success:hover {
  background-color: #3D7A28;
}

.btn-success:active {
  background-color: #2D5F1E;
}

.btn-success:disabled {
  background-color: #E5E6E6;
  color: #8B8988;
  cursor: not-allowed;
}

/* Button Sizes */
.btn-sm {
  padding: 8px 24px;
  font-size: 14px;
  line-height: 1.5;
}

.btn-lg {
  padding: 16px 40px;
  font-size: 18px;
  line-height: 1.75;
}

/* Full Width Button */
.btn-full {
  width: 100%;
}

/* ==================== Link Components ==================== */

/* Text Link */
a,
.text-link,
a.text-link {
  /*color: var(--primary-colors-primary-green-100, #549b35);*/
  color: var(--link-text-color);
  font-family: var(--en-text-xs-font-family, 'Inter', sans-serif);
  font-weight: var(--en-text-xs-font-weight, 500);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

a:hover,
.text-link:hover,
a.text-link:hover {
  /*color: #3d7a28;*/
  text-decoration: underline;
  font-weight: 600;
}

/* Resend Link */
.resend-link {
  color: var(--primary-colors-primary-blue-100, #004077);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.resend-link:hover {
  /*color: #003366;*/
  text-decoration: underline;
  font-weight: 600;
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==================== Global Loading Overlay ==================== */
#globalLoadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 11000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
}

#globalLoadingOverlay.is-visible {
  display: flex;
}

#globalLoadingOverlay .global-loading-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  max-width: min(320px, calc(100vw - 48px));
}

#globalLoadingOverlay .global-loading-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(0, 64, 119, 0.20);
  border-top-color: rgba(0, 64, 119, 0.95);
  animation: paasSpin 0.9s linear infinite;
}

#globalLoadingOverlay .global-loading-text {
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 12px;
  line-height: 18px;
  color: var(--primary-colors-primary-grey-100, #3e3a39);
  text-align: center;
  word-break: break-word;
}

@keyframes paasSpin {
  to {
    transform: rotate(360deg);
  }
}

#notificationPopup .popup-window {
  background-color: #FFF;
  border-radius: 16px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  padding: 24px;
  position: relative;
}

#notificationPopup .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

#notificationPopup .popup-icon {
  display: flex;
  align-items: center;
}

#notificationPopup .popup-icon-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #FFEB3B;
  border: 2px solid #F44336;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

#notificationPopup .popup-icon-text {
  color: #000;
  font-size: 16px;
  font-weight: 700;
}

#notificationPopup .close-popup {
  font-size: 24px;
  cursor: pointer;
  color: #666;
  line-height: 1;
}

#notificationPopup .popup-body {
  margin-bottom: 20px;
}

#notificationPopup .popup-title {
  margin: 0 0 10px 0;
  color: #000;
  font-size: 18px;
  font-weight: 600;
}

#notificationPopup .popup-message {
  margin: 0;
  color: #000;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.8;
}
.popup-message .text-link,
.popup-message .text-normal {
  font-size: 14px;
}

#notificationPopup .popup-footer {
  width: 100%;
  padding-top: 10px;
}

#notificationPopup .popup-footer .btn {
  width: 71px;
  height: 34px;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  float: right;
}

#notificationPopup .btn-confirm {
  background-color: #004077;
  color: white;
  border: none;
}

#notificationPopup .btn-cancel {
  background-color: white;
  color: 004077;
  border: none;
  margin-right: 10px;
}

.passwordEyes{
  cursor: pointer;
}


/* ==================== Responsive Design for Components ==================== */

@media (max-width: 480px) {
  .code-input {
    width: calc((100% - 40px) / 6);
    height: auto;
    min-width: 40px;
    max-width: 64px;
    min-height: 40px;
    max-height: 64px;
    font-size: 32px;
    line-height: 40px;
    padding: 1px 4px;
    aspect-ratio: 1 / 1;
  }

  .btn-primary,
  .btn-secondary {
    padding: 10px 24px;
    font-size: 14px;
    line-height: 24px;
  }
}

@media (max-width: 768px) {
  .form-field {
    width: unset;
  }
}
