@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&display=swap');
@import url('./jalex-tokens.css');

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--theme-palette-color-7);
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--theme-palette-color-4);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

#jalex-sign-root {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle at top, rgba(243, 185, 55, 0.08) 0%, rgba(249, 249, 251, 1) 70%);
}

.jalex-sign-container {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.jalex-sign-card {
  width: 100%;
  background: var(--theme-palette-color-8);
  border: 1px solid var(--theme-border-color);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(17, 21, 24, 0.05);
  transition: all 0.3s ease;
}

.jalex-sign-logo {
  width: 160px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 20px;
  display: block;
}

/* Titles and Typography */
.jalex-sign-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 10px;
  color: var(--theme-palette-color-4);
}

.jalex-sign-title-large {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 26px;
  margin: 0 0 12px;
  color: var(--theme-palette-color-4);
  line-height: 1.25;
}

.jalex-sign-status {
  font-size: 14px;
  line-height: 1.6;
  color: var(--theme-palette-color-3);
  margin: 0 0 20px;
}

/* Spinner Animation */
.jalex-sign-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(243, 185, 55, 0.2);
  border-top-color: var(--theme-palette-color-1);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: jalex-spin 0.8s linear infinite;
}

@keyframes jalex-spin {
  to { transform: rotate(360deg); }
}

/* Multi-Document Badge */
.jalex-doc-progress {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #b8521e;
  background: var(--theme-palette-color-5);
  border: 1px solid rgba(243, 185, 55, 0.4);
  border-radius: 999px;
  padding: 6px 16px;
  margin: 0 0 18px;
}

/* Already Signed / Confirmation View */
.jalex-signed-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--theme-palette-color-1);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: jalex-pop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.jalex-signed-check svg {
  width: 32px;
  height: 32px;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

@keyframes jalex-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.jalex-signed-message {
  font-size: 15px;
  line-height: 1.6;
  color: var(--theme-palette-color-3);
  margin: 0 0 8px;
}

.jalex-signed-subnote {
  font-size: 13px;
  line-height: 1.5;
  color: var(--theme-palette-color-3);
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--theme-border-color);
}

.jalex-signed-phone {
  color: var(--theme-palette-color-1);
  font-weight: 600;
  text-decoration: none;
}

.jalex-signed-phone:hover {
  text-decoration: underline;
}

/* Error View */
.jalex-sign-error {
  color: #d32f2f;
  font-size: 14px;
  line-height: 1.5;
}

.jalex-sign-error strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--theme-palette-color-4);
}

.jalex-sign-error-detail {
  font-size: 12px;
  color: var(--theme-palette-color-3);
  margin-top: 12px;
}

/* Powered By Footer */
.jalex-poweredby {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--theme-palette-color-3);
  text-transform: uppercase;
}

.jalex-poweredby-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 700;
  color: var(--theme-palette-color-4);
}

/* Expired Link View */
.jalex-expired-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5a623, #e8921a);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: jalex-pop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.jalex-expired-icon svg {
  width: 32px;
  height: 32px;
  stroke: #ffffff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* Site Link */
.jalex-site-link {
  display: inline-block;
  color: var(--theme-palette-color-1);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.jalex-site-link:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .jalex-sign-card {
    padding: 24px 16px;
    border-radius: 8px;
  }
  .jalex-sign-title {
    font-size: 20px;
  }
  .jalex-sign-title-large {
    font-size: 24px;
  }
}
