/* Percentage Decrease Calculator – CSS
   Mirroring Army Body Fat Calculator final version
*/

:root {
  --cg-body-bg: #f3f4f6;
  --cg-card-bg: #ffffff;
  --cg-soft-bg: #f9fafb;
  --cg-border: #e5e7eb;
  --cg-border-strong: #d1d5db;
  --cg-text-main: #111827;
  --cg-text-muted: #6b7280;
  --cg-text-soft: #9ca3af;
  --cg-primary: #1d4ed8;
  --cg-primary-soft: #dbeafe;
  --cg-primary-strong: #1e3a8a;
  --cg-accent: #22c55e;
  --cg-error: #dc2626;
  --cg-success-bg: #ecfdf3;
  --cg-error-bg: #fef2f2;
  --cg-neutral-bg: #eff6ff;
  --cg-shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.18);
  --cg-radius-lg: 1rem;
  --cg-radius-pill: 9999px;
  --cg-radius-md: 0.5rem;
}

/* WRAPPER */
/* Main wrapper – no extra bottom padding */
.pdc-layout {
  max-width: 960px;
  margin: 24px auto 0;
  padding: 0 16px 0; /* bottom 0 so gap is controlled by card + footer */
}

/* HERO HEADER – green/blue gradient, square-rounded like Army */
.pdc-hero {
  border-radius: 24px;
  padding: 24px 32px;
  margin: 8px auto 24px;
  background: linear-gradient(90deg, #1d4ed8 0%, #06b6d4 50%, #22c55e 100%);
  color: #ffffff;
  box-shadow: var(--cg-shadow-soft);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.pdc-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top right,
    rgba(255, 255, 255, 0.3),
    transparent 60%
  );
  opacity: 0.9;
  pointer-events: none;
}

.pdc-hero__title {
  margin: 0 0 6px;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1;
  color: #ffffff;
}

.pdc-hero__subtitle {
  margin: 0;
  font-size: 0.95rem;
  max-width: 640px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  position: relative;
  z-index: 1;
  margin-left: auto;
  margin-right: auto;
}

/* MAIN CARD */
.cg-card {
  background: var(--cg-card-bg);
  border-radius: var(--cg-radius-lg);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1);
  padding: 20px 18px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--cg-border);
}

.cg-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cg-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cg-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cg-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cg-text-main);
}

.cg-label-suffix {
  font-size: 0.8rem;
  color: var(--cg-text-soft);
}

/* INPUTS */
.cg-input,
.cg-textarea {
  width: 100%;
  padding: 9px 11px;
  font-size: 0.95rem;
  border-radius: 0.55rem;
  border: 1px solid var(--cg-border-strong);
  background-color: #ffffff;
  color: var(--cg-text-main);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease,
    background-color 0.14s ease;
  -webkit-appearance: none;
  appearance: none;
}

.cg-input:focus,
.cg-textarea:focus {
  border-color: var(--cg-primary);
  box-shadow: 0 0 0 1px var(--cg-primary-soft);
}

.cg-input[readonly] {
  background-color: var(--cg-soft-bg);
  color: var(--cg-text-main);
}

.cg-help {
  font-size: 0.78rem;
  color: var(--cg-text-soft);
  line-height: 1.45;
}

/* RESULT MESSAGE */
.cg-result-message {
  border-radius: 0.55rem;
  padding: 9px 11px;
  font-size: 0.85rem;
  line-height: 1.4;
  border: 1px dashed transparent;
  color: var(--cg-text-muted);
  background: var(--cg-soft-bg);
  min-height: 0;
}

.cg-result-message--success {
  border-color: #16a34a;
  background-color: var(--cg-success-bg);
  color: #166534;
}

.cg-result-message--error {
  border-color: var(--cg-error);
  background-color: var(--cg-error-bg);
  color: #991b1b;
}

.cg-result-message--neutral {
  border-color: var(--cg-primary-soft);
  background-color: var(--cg-neutral-bg);
  color: var(--cg-primary-strong);
}

/* ACTION BUTTONS – layout matches Army */
.cg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  margin-top: 4px;
}

.cg-actions-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cg-actions-right {
  margin-left: auto;
}

/* Base pill button style */
.cg-btn {
  border-radius: var(--cg-radius-pill);
  border: 1px solid var(--cg-primary);
  font-size: 0.85rem;
  padding: 7px 14px;
  background-color: #ffffff;
  color: var(--cg-primary-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.16s ease, color 0.16s ease,
    box-shadow 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}

.cg-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background-color: var(--cg-primary-soft);
  color: var(--cg-primary-strong);
  font-size: 0.72rem;
  font-weight: 700;
}

/* Neutral buttons: Reload, Clear – white pill, blue hover */
.cg-btn--neutral {
  border-color: var(--cg-border-strong);
  color: var(--cg-text-main);
}

.cg-btn--neutral:hover {
  background-color: var(--cg-primary);
  color: #ffffff;
  border-color: var(--cg-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.cg-btn--neutral:hover .cg-btn__icon {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Share button – pink alert pill like Army */
.cg-btn--share {
  border-color: #fecaca;
  background-color: #fef2f2;
  color: #b91c1c;
}

.cg-btn--share .cg-btn__icon {
  background-color: #fee2e2;
  color: #b91c1c;
}

.cg-btn--share:hover {
  background-color: #ef4444;
  color: #ffffff;
  border-color: #b91c1c;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.cg-btn--share:hover .cg-btn__icon {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* LIKE / DISLIKE */
.cg-like-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--cg-text-soft);
}

.cg-like-btn {
  border-radius: var(--cg-radius-pill);
  border: 1px solid var(--cg-border-strong);
  padding: 5px 11px;
  background-color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #1f2937;
  transition: background-color 0.16s ease, color 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
}

.cg-like-btn--ghost {
  background-color: #ffffff;
}

.cg-like-btn:hover {
  background-color: var(--cg-primary);
  color: #ffffff;
  border-color: var(--cg-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.cg-like-btn--pressed {
  transform: scale(0.95);
}

.cg-like-icon {
  font-size: 0.92rem;
}

.cg-like-divider {
  font-size: 0.85rem;
  color: var(--cg-text-soft);
}

/* FEEDBACK ROW */
.cg-feedback-row {
  border-top: 1px dashed var(--cg-border);
  padding-top: 10px;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--cg-text-muted);
}

.cg-feedback-buttons {
  display: inline-flex;
  gap: 6px;
}

.cg-feedback-btn {
  border-radius: var(--cg-radius-pill);
  border: 1px solid var(--cg-border-strong);
  background-color: #ffffff;
  font-size: 0.78rem;
  padding: 5px 14px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease;
}

.cg-feedback-btn--yes {
  border-color: #16a34a;
  color: #166534;
}

.cg-feedback-btn--no {
  border-color: #f97316;
  color: #9a3412;
}

.cg-feedback-btn:hover {
  background-color: var(--cg-primary);
  color: #ffffff;
  border-color: var(--cg-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* USAGE CARD */
/* People used this calculator card */
.pdc-usage-card {
  background: var(--cg-card-bg);
  border-radius: var(--cg-radius-lg);
  padding: 16px 16px 14px;
  border: 1px solid var(--cg-border);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1);
  margin: 0 0 10px; /* 10px gap before footer, like Army */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pdc-usage-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--cg-text-main);
}

.pdc-usage-number {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--cg-primary-strong);
  margin: 4px 0 0;
}

.pdc-usage-platform {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--cg-text-muted);
}

.pdc-usage-note {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--cg-text-soft);
  line-height: 1.5;
}

/* Footer – flat bar, same width as calculator */
/* Footer – same visible width as card, aligned perfectly */
.cg-powered-footer {
  box-sizing: border-box;
  width: calc(100% - 32px);  /* layout width minus 16px padding each side */
  max-width: 960px;          /* same container width as calculator */
  margin: 0 auto;            /* center under card */
  padding: 10px 16px;
  background-color: #111827;
  color: #ffffff;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;          /* absolutely no rounding */
}

.cg-powered-footer a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.cg-powered-footer a:hover {
  text-decoration: underline;
}

.cg-powered-footer a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.cg-powered-footer a:hover {
  text-decoration: underline;
}

/* OVERLAYS (feedback + share) */
.cg-modal-overlay,
.pdc-share-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.cg-modal-overlay--visible,
.pdc-share-modal-overlay--visible {
  display: flex;
}

/* FEEDBACK MODAL – tuned to Army screenshot */
.cg-modal {
  background: #ffffff;
  border-radius: 1rem;
  padding: 22px 28px 20px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--cg-border);
  text-align: center;
}

.cg-modal__text {
  font-size: 0.95rem;
  margin: 6px 0 18px;
  color: var(--cg-text-main);
}

.cg-modal__btn {
  display: inline-flex;
  margin: 0 auto;
  border-radius: 999px;
  border: 1px solid #2563eb;
  padding: 8px 22px;
  font-size: 0.86rem;
  cursor: pointer;
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 500;
  transition: background-color 0.16s ease, color 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease, transform 0.08s ease;
}

.cg-modal__btn:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

/* SHARE MODAL – Army Body Fat style */
.pdc-share-modal {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 18px 20px 18px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.35);
  border: 1px solid var(--cg-border);
  position: relative;
}

.pdc-share-close-icon {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--cg-text-soft);
}

.pdc-share-close-icon:hover {
  color: var(--cg-text-main);
}

.pdc-share-modal__title {
  margin: 0 0 3px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cg-text-main);
}

.pdc-share-modal__subtitle {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--cg-text-soft);
}

.pdc-share-modal__bar {
  width: 70px;
  height: 2px;
  border-radius: 999px;
  background-color: var(--cg-primary);
  margin: 4px 0 12px;
}

.pdc-share-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--cg-text-muted);
  margin-bottom: 16px;
}

.pdc-share-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* Social icon buttons row */
.pdc-share-icons-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.pdc-share-icon {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--cg-text-muted);
}

.pdc-share-icon__circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
}

/* Circle colors similar to logos */
.pdc-share-icon__circle--facebook {
  background-color: #1877f2;
}

.pdc-share-icon__circle--x {
  background-color: #111827;
}

.pdc-share-icon__circle--linkedin {
  background-color: #0a66c2;
}

.pdc-share-icon__circle--whatsapp {
  background-color: #22c55e;
}

.pdc-share-icon__label {
  text-align: center;
}

/* Link + Copy row */
.pdc-share-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdc-share-link-input {
  flex: 1 1 auto;
  border-radius: 999px;
  border: 1px solid var(--cg-border-strong);
  padding: 7px 12px;
  font-size: 0.82rem;
  background-color: var(--cg-soft-bg);
  color: var(--cg-text-main);
  outline: none;
}

.pdc-share-link-input:focus {
  border-color: var(--cg-primary);
  box-shadow: 0 0 0 1px var(--cg-primary-soft);
}

.pdc-share-link-copy-btn {
  border-radius: 999px;
  border: 1px solid var(--cg-primary);
  padding: 7px 16px;
  font-size: 0.82rem;
  background-color: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, transform 0.08s ease;
}

.pdc-share-link-copy-btn:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

/* RESPONSIVE */
@media (max-width: 640px) {
  .pdc-hero {
    padding: 18px 16px;
    margin-bottom: 16px;
  }
  .pdc-hero__title {
    font-size: 1.45rem;
  }
  .pdc-layout {
    margin-top: 16px;
  }
  .cg-card {
    padding: 16px 14px;
  }
  .cg-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cg-actions-left {
    width: 100%;
    justify-content: flex-start;
  }
  .cg-actions-left .cg-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .cg-actions-right {
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }
  .pdc-share-modal {
    padding: 16px 14px 16px;
  }
  .pdc-share-icons-row {
    justify-content: space-around;
  }
  .pdc-share-link-copy-btn {
    padding-inline: 12px;
  }
}
/* Footer wrapper (for correct alignment like Army) */
.pdc-footer-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Actual footer */
.cg-powered-footer {
    box-sizing: border-box;
    width: calc(100% - 32px);   /* matches .pdc-layout padding */
    max-width: 925px;          /* container limit */
    margin: 0 auto;            /* center align */
    padding: 12px 16px;
    background-color: #111827;
    color: #ffffff;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    border-radius: 0;          /* no rounded corners */
}
.cg-powered-footer a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.cg-powered-footer a:hover {
  text-decoration: underline;
}
/* FINAL OVERRIDE – remove all footer rounding everywhere */
.cg-powered-footer,
.pdc-footer-wrap,
.cg-powered-footer * {
    border-radius: 0 !important;
}

