/* ==================== Credential Module ==================== */

.cred-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 8px;
}

.cred-header {
  margin-bottom: 16px;
}

.cred-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.cred-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.cred-header-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}
.cred-header-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--primary, #0052d9);
  text-decoration: none;
  font-weight: 500;
}
.cred-header-link:hover {
  text-decoration: underline;
}

/* ==================== Security Banner ==================== */

.cred-security-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
}

.cred-security-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.12);
  border-radius: 8px;
  color: #10b981;
}

.cred-security-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cred-security-text strong {
  font-size: 13px;
  color: #059669;
  font-weight: 600;
}

/* ==================== Layout ==================== */

.cred-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .cred-layout {
    grid-template-columns: 1fr;
  }
}

/* ==================== Card ==================== */

.cred-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.cred-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ==================== Form ==================== */

.cred-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cred-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cred-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cred-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  background: var(--surface-bg, #fff);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.cred-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 82, 217, 0.1);
}

.cred-input::placeholder {
  color: var(--text-tertiary);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Hide number input spinners */
.cred-input[type="number"]::-webkit-inner-spin-button,
.cred-input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cred-input[type="number"] {
  -moz-appearance: textfield;
}

.cred-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface-bg, #fff);
  color: var(--text-primary);
  cursor: pointer;
  box-sizing: border-box;
}

.cred-hint {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Input group (input + toggle button) */
.cred-input-group {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
}

.cred-input-group .cred-input {
  padding-right: 40px;
}

.cred-toggle-vis {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s;
}

.cred-toggle-vis:hover {
  color: var(--text-primary);
}

/* Generate button */
.cred-gen-btn {
  width: 100%;
  margin-top: 16px;
  justify-content: center;
}

/* ==================== How It Works (steps) ==================== */

.cred-how-it-works {
  margin-top: 16px;
  padding: 16px;
  background: var(--hover-bg, #f9fafb);
  border-radius: 10px;
  border: 1px dashed var(--border-color);
}

.cred-how-it-works h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.cred-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cred-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.cred-step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
}

/* ==================== Result Section ==================== */

.cred-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.cred-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cred-summary-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 72px;
}

.cred-summary-val {
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--text-primary);
  background: var(--hover-bg);
  padding: 2px 8px;
  border-radius: 4px;
}

/* UserSig output */
.cred-output-block {
  background: var(--hover-bg, #f5f5f5);
  border-radius: 8px;
  overflow: hidden;
}

.cred-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}

.cred-output-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cred-usersig-pre {
  margin: 0;
  padding: 12px;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  color: var(--text-primary);
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.6;
}

/* Quick copy chips */
.cred-quick-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.cred-copy-chip {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.cred-copy-chip:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(0, 82, 217, 0.04);
}

/* Usage hint */
.cred-usage-hint {
  margin-top: 16px;
  padding: 16px;
  background: var(--hover-bg, #f9fafb);
  border-radius: 8px;
  border: 1px dashed var(--border-color);
}

.cred-usage-hint h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px 0;
}

.cred-usage-hint p {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}
