/**
 * StockAI - Additional Styles
 * Mobile-first optimization with centered card layout
 */

/* Mobile-first: Centered card layout */
* {
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  padding: 0 !important;
  margin: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 100% !important;
  width: 100% !important;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  border-radius: 24px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08) !important;
  min-height: fit-content;
  max-height: 100vh;
  height: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 100%;
  max-width: 680px;
  margin: 0;
  box-sizing: border-box;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile Optimization - Fit content in one screen */
@media (max-width: 768px) {
  html {
    height: 100%;
    overflow: hidden;
  }

  body {
    padding: 0 !important;
    margin: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  }

  .container {
    max-width: 100% !important;
    width: 100% !important;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .card {
    border-radius: 24px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08) !important;
    min-height: calc(100vh - 20px);
    height: auto;
    padding: 24px 18px;
    width: calc(100% - 20px);
    margin: 10px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .logo {
    margin-bottom: 20px;
  }

  .logo-icon {
    width: 50px;
    height: 50px;
    font-size: 22px;
  }

  .logo-text {
    font-size: 32px;
  }

  h1 {
    font-size: 36px;
    margin-bottom: 12px;
    line-height: 1.15;
  }

  .subtitle {
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.5;
  }

  .features {
    margin: 24px 0;
    gap: 12px;
  }

  .feature {
    padding: 16px 10px;
  }

  .feature i {
    font-size: 28px;
    margin-bottom: 8px;
  }

  .feature-text {
    font-size: 14px;
    font-weight: 500;
  }

  .step-indicator {
    margin: 24px 0;
    gap: 10px;
  }

  .step {
    width: 12px;
    height: 12px;
  }

  .step.active {
    width: 32px;
  }

  .input-container {
    margin-bottom: 18px;
  }

  .code-input {
    padding: 16px 18px;
    font-size: 16px;
    border-radius: 16px;
  }

  .input-hint {
    font-size: 14px;
    margin-top: 10px;
  }

  .btn {
    padding: 16px 22px;
    font-size: 17px;
    border-radius: 16px;
  }

  .trust-badges {
    gap: 16px;
    margin-top: 18px;
    font-size: 14px;
  }

  .disclaimer {
    font-size: 12px;
    margin-top: 18px;
    line-height: 1.5;
  }

  .loading-spinner {
    width: 45px;
    height: 45px;
    margin-bottom: 12px;
  }

  #step2 h2 {
    font-size: 20px;
    margin-bottom: 6px;
  }

  #step2 .subtitle {
    font-size: 13px;
    margin-bottom: 0;
  }

  .success-animation {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
  }

  .success-animation .checkmark {
    width: 60px;
    height: 60px;
  }

  #step3 h2 {
    font-size: 22px;
    margin-bottom: 6px;
  }

  .result-message {
    margin: 12px 0;
    font-size: 16px;
  }

  #step3 .subtitle {
    margin-bottom: 16px;
    font-size: 13px;
  }

  .btn-whatsapp {
    margin-bottom: 12px;
  }

  #step3 .trust-badges {
    margin-top: 12px;
  }

  #step3 .disclaimer {
    margin-top: 12px;
  }
}

/* Extra small screens - further optimization */
@media (max-width: 480px) {
  html {
    height: 100%;
    overflow: hidden;
  }

  body {
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh;
    overflow: hidden;
  }

  .card {
    padding: 20px 16px;
    border-radius: 24px !important;
    min-height: calc(100vh - 16px);
    height: auto;
    width: calc(100% - 16px);
    margin: 8px;
    max-height: calc(100vh - 16px);
    justify-content: flex-start;
  }

  .logo {
    margin-bottom: 18px;
  }

  .logo-icon {
    width: 46px;
    height: 46px;
    font-size: 20px;
  }

  .logo-text {
    font-size: 28px;
  }

  h1 {
    font-size: 32px;
    margin-bottom: 10px;
    line-height: 1.15;
  }

  .subtitle {
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.5;
  }

  .features {
    margin: 22px 0;
    gap: 10px;
  }

  .feature {
    padding: 14px 8px;
  }

  .feature i {
    font-size: 24px;
    margin-bottom: 7px;
  }

  .feature-text {
    font-size: 13px;
    font-weight: 500;
  }

  .step-indicator {
    margin: 22px 0;
  }

  .input-container {
    margin-bottom: 16px;
  }

  .code-input {
    padding: 14px 16px;
    font-size: 15px;
  }

  .btn {
    padding: 14px 20px;
    font-size: 16px;
  }

  .trust-badges {
    gap: 14px;
    margin-top: 16px;
    font-size: 13px;
  }

  .disclaimer {
    font-size: 11px;
    margin-top: 16px;
    line-height: 1.5;
  }
}

/* Page Content Styles (for pages directory) */
.page-content {
  min-height: calc(100vh - 200px);
  padding: 2rem 1rem;
}

.page-content .container {
  max-width: 800px;
  margin: 0 auto;
}

.page-content h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: #212529;
}

.page-content h2 {
  font-size: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #495057;
}

.page-content h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #6c757d;
}

.page-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.page-content ul,
.page-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.page-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.page-content a {
  color: #007bff;
  text-decoration: none;
}

.page-content a:hover,
.page-content a:focus {
  text-decoration: underline;
}

.contact-info {
  margin: 1.5rem 0;
}

.contact-info h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.input-message {
  display: none;
  margin-top: 9px;
  color: #8a5a16;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}

.input-message.visible {
  display: block;
}

/* Mature financial visual theme */
:root {
  --primary: #173f67;
  --secondary: #246b9b;
  --accent: #c9973e;
  --background: #eef3f7;
  --card-bg: #ffffff;
  --text-primary: #1d2d3d;
  --text-secondary: #526476;
  --text-light: #7b8b99;
  --border: #cbd6df;
  --success: #2f8f68;
  --whatsapp: #238b63;
  --shadow-lg: 0 18px 45px rgba(24, 49, 72, 0.14);
}

body {
  background: linear-gradient(135deg, #e8eff4 0%, #f7f9fb 58%, #e4edf3 100%);
  color: var(--text-primary);
}

.card {
  border: 1px solid #d7e0e7;
  border-radius: 14px !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 32px 34px;
}

.card::before {
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.card:hover {
  transform: none;
  box-shadow: 0 20px 48px rgba(24, 49, 72, 0.17) !important;
}

.logo {
  gap: 10px;
  margin-bottom: 22px;
}

.logo-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(23, 63, 103, 0.22);
  animation: none;
}

.logo-text {
  color: var(--primary);
  background: none;
  -webkit-text-fill-color: initial;
}

h1 {
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 17px;
}

.features {
  gap: 12px;
}

.feature {
  border: 1px solid #dce4ea;
  border-radius: 10px;
  background: #f8fafc;
  padding: 15px 10px;
}

.feature:hover {
  transform: none;
  border-color: #c6d4df;
  box-shadow: none;
}

.feature i {
  color: var(--secondary);
}

.feature-text {
  color: var(--text-secondary);
  font-size: 15px;
}

.step-indicator {
  margin: 26px 0;
}

.step.active {
  background: var(--primary);
}

.code-input {
  border-radius: 10px;
  border-color: #bccbd7;
  background: #fff;
  font-size: 17px;
  min-height: 54px;
}

.code-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(36, 107, 155, 0.13);
  transform: none;
}

.btn {
  border-radius: 10px;
  background: var(--primary);
  box-shadow: 0 5px 14px rgba(23, 63, 103, 0.23);
  font-size: 17px;
  min-height: 54px;
}

.btn:hover {
  transform: translateY(-1px);
  background: #123452;
  box-shadow: 0 8px 18px rgba(23, 63, 103, 0.28);
}

.btn-whatsapp {
  background: var(--whatsapp);
  box-shadow: 0 5px 14px rgba(35, 139, 99, 0.23);
}

.btn-whatsapp:hover {
  background: #1d7655;
  box-shadow: 0 8px 18px rgba(35, 139, 99, 0.28);
}

.trust-badges {
  gap: 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

.trust-badge i {
  color: var(--success);
}

.disclaimer {
  color: #71818e;
  font-size: 12px;
}

@media (max-width: 768px) {
  .card {
    padding: 28px 22px;
    border-radius: 14px !important;
  }

  h1 {
    font-size: 35px;
  }

  .subtitle {
    font-size: 17px;
  }

  .code-input,
  .btn {
    min-height: 56px;
    font-size: 17px;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 24px 18px;
    border-radius: 12px !important;
  }

  h1 {
    font-size: 32px;
  }

  .trust-badges {
    gap: 13px;
    font-size: 14px;
  }
}

/* ============================================
   UI/UX refinement - professional AI FinTech
   ============================================ */

/* Hero badge */
.hero-badge {
  display: inline-block;
  margin: 0 auto 12px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--secondary, #246b9b);
  background: rgba(36, 107, 155, 0.08);
  border: 1px solid rgba(36, 107, 155, 0.18);
  border-radius: 999px;
}

/* h1 层次优化 */
h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

/* Feature 卡片：加副标题 */
.feature {
  text-align: center;
  padding: 18px 12px;
}

.feature i {
  margin-bottom: 10px;
  font-size: 26px;
  color: var(--secondary, #246b9b);
}

.feature-text {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary, #1d2d3d);
}

.feature-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-light, #7b8b99);
  line-height: 1.4;
}

/* 输入框与按钮：更大、高对比度 */
.code-input {
  border: 1.5px solid #bccbd7;
  border-radius: 12px;
  font-size: 17px;
  min-height: 56px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.code-input:focus {
  border-color: var(--secondary, #246b9b);
  box-shadow: 0 0 0 3px rgba(36, 107, 155, 0.15);
}

.btn {
  width: 100%;
  border-radius: 12px;
  background: var(--primary, #173f67);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
  min-height: 56px;
  border: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  background: #123452;
  box-shadow: 0 10px 22px rgba(23, 63, 103, 0.28);
}

/* WhatsApp 按钮：主文字 + 副标题两行 */
.btn-whatsapp {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--whatsapp, #238b63);
  line-height: 1.3;
}

.btn-whatsapp:hover {
  background: #1d7655;
}

.btn-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.85;
}

/* Loading 页：居中 + 呼吸动画 */
#step2 {
  text-align: center;
}

#step2 h2 {
  font-size: 22px;
  font-weight: 700;
}

#step2 .subtitle {
  font-size: 14px;
  color: var(--text-light, #7b8b99);
}

/* 完成页：清晰层次 */
#step3 {
  text-align: center;
}

#step3 h2 {
  font-size: 24px;
  font-weight: 700;
}

.result-message {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary, #1d2d3d);
}

#step3 .subtitle {
  font-size: 14px;
  color: var(--text-light, #7b8b99);
}

/* Trust 元素 */
.trust-badges {
  color: var(--text-secondary, #526476);
  font-size: 14px;
}

.trust-badge i {
  color: var(--success, #2f8f68);
}

/* 免责声明：清晰但克制 */
.disclaimer {
  font-size: 12px;
  color: #71818e;
  line-height: 1.5;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ============ 移动端重点优化（375 / 390 / 414） ============ */
@media (max-width: 414px) {
  h1 {
    font-size: 33px;
  }

  .subtitle {
    font-size: 15px;
  }

  .features {
    gap: 10px;
  }

  .feature {
    padding: 14px 8px;
  }

  .feature-text {
    font-size: 14px;
  }

  .feature-sub {
    font-size: 11px;
  }

  .code-input,
  .btn {
    min-height: 54px;
    font-size: 16px;
  }
}

@media (max-width: 375px) {
  h1 {
    font-size: 30px;
  }

  .card {
    padding: 20px 14px;
  }

  .feature-sub {
    display: block;
  }

  .trust-badges {
    font-size: 13px;
  }
}

/* ============================================
   Fine UI adjustments (text spacing + hierarchy)
   ============================================ */

/* 标题与副标题呼吸空间 */
h1 {
  margin-top: 4px;
  margin-bottom: 12px;
}

.hero-badge {
  margin-bottom: 14px;
}

.subtitle {
  margin-top: 0;
}

/* 让输入框 + CTA 成为第一屏最明显交互元素 */
.input-container {
  margin-bottom: 14px;
}

.code-input {
  border-width: 1.5px;
}

.btn {
  letter-spacing: 0.5px;
}

/* 三个功能卡片等高 */
.features {
  align-items: stretch;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  box-sizing: border-box;
}

.feature-sub {
  flex: 1;
  display: flex;
  align-items: center;
}

/* 移动端避免换行过多、无横向滚动 */
@media (max-width: 414px) {
  .subtitle {
    margin-bottom: 20px;
    max-width: 96%;
  }

  .feature-sub {
    font-size: 11px;
    line-height: 1.3;
  }
}

@media (max-width: 375px) {
  h1 {
    margin-bottom: 10px;
  }

  .subtitle {
    font-size: 14px;
    line-height: 1.4;
  }
}

/* ============================================
   Final UI polish - visual hierarchy
   ============================================ */

/* 完成页 WhatsApp 解释区 */
.cta-headline {
  margin: 18px 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #1d2d3d);
}

.cta-explain {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-light, #7b8b99);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA 视觉焦点 */
.btn-whatsapp {
  min-height: 58px;
  border-radius: 12px;
}

/* 第一屏视觉层级：CTA 突出 */
#step1 .btn {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 标题字重 */
h1 {
  font-weight: 700;
}

.hero-badge {
  font-weight: 600;
}

/* 移动端完成页说明紧凑 */
@media (max-width: 414px) {
  .cta-headline {
    font-size: 17px;
    margin-top: 14px;
  }

  .cta-explain {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
  }
}

@media (max-width: 375px) {
  .cta-explain {
    max-width: 94%;
  }
}

