/* shared/components.css — Shared component styles for CreditStud.io
 *
 * This file contains styles used across multiple calculator pages.
 * Page-specific overrides remain in style.css, rewards/rewards.css, and
 * debt-planner/planner.css.
 *
 * To update: edit this file, then run `npm run build` to verify no breakage.
 */

/* ============================================ */
/* Buttons                                      */
/* ============================================ */
.btn-primary,
.btn-ghost,
.btn-small,
.btn-add,
.btn-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
  padding: 12px 24px;
  font-size: 1rem;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  color: #2563eb;
  border: 1px solid #e5e7eb;
  padding: 10px 20px;
  font-size: 0.9rem;
}
.btn-ghost:hover { background: #f3f4f6; border-color: #2563eb; }

.btn-small {
  background: #f3f4f6;
  color: #374151;
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 6px;
}
.btn-small:hover { background: #e5e7eb; }

.btn-add {
  background: #eff6ff;
  color: #2563eb;
  padding: 8px 16px;
  font-size: 0.875rem;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
}
.btn-add:hover { background: #dbeafe; border-color: #2563eb; }

.btn-loading {
  opacity: 0.7;
  pointer-events: none;
  position: relative;
}
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}

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

/* ============================================ */
/* Step Headers                                 */
/* ============================================ */
.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px;
}
.step-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================ */
/* Result Cards                                 */
/* ============================================ */
.result-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s, transform 0.15s;
}
.result-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.result-card:first-child {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px #2563eb22;
}

/* ============================================ */
/* Disclosure Banner                            */
/* ============================================ */
.site-disclosure-banner {
  background: #fef3c7;
  border-bottom: 1px solid #fbbf24;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: #92400e;
  text-align: center;
}
.site-disclosure-banner a {
  color: #b45309;
  text-decoration: underline;
}

/* ============================================ */
/* Data Freshness Stamp                         */
/* ============================================ */
.data-stamp {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.data-stamp-dot {
  color: #10b981;
  font-size: 0.6rem;
}

/* ============================================ */
/* Share Button                                 */
/* ============================================ */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: #374151;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.share-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.share-btn-success {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

/* ============================================ */
/* Email Capture Widget                         */
/* ============================================ */
.email-capture-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.email-capture-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.email-capture-modal {
  background: white;
  border-radius: 12px 12px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  position: relative;
}

.email-capture-overlay.visible .email-capture-modal {
  transform: translateY(0);
}

.email-capture-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #6b7280;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.email-capture-close:hover {
  background: #f3f4f6;
}

.email-capture-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.email-capture-input {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #111827;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.email-capture-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.email-capture-button {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.email-capture-button:hover {
  background: #1d4ed8;
}

.email-capture-button:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.email-capture-privacy {
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
  margin: 16px 0 0;
  line-height: 1.4;
}

.email-capture-inline {
  padding: 20px;
  border-radius: 16px;
  font-size: 0.9rem;
  background: #f9fafb;
  margin: 20px 0;
}

.email-capture-inline-button {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 10px;
}

.email-capture-inline-button:hover {
  background: #1d4ed8;
}

/* Apply Now / Learn More Buttons */

.apply-now-btn {
  background: #10b981 !important;
  color: white !important;
}

.learn-more-btn {
  background: transparent !important;
  color: #2563eb !important;
  border: 1px solid #e5e7eb !important;
}

.ftc-disclosure {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 8px;
  text-align: center;
  font-style: italic;
}

.ftc-disclosure a {
  color: #2563eb;
  text-decoration: underline;
}

.btn-apply {
  display: block;
  width: 100%;
  margin-top: 16px;
  text-align: center;
}