/* Payment Plan Calculator – Frontend */

:root {
  --ppc-primary: #0f766e;
  --ppc-primary-hover: #0d9488;
  --ppc-bg: #f8fafc;
  --ppc-card: #ffffff;
  --ppc-border: #e2e8f0;
  --ppc-text: #1e293b;
  --ppc-muted: #64748b;
  --ppc-success: #059669;
  --ppc-error: #dc2626;
  --ppc-radius: 12px;
  --ppc-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  --ppc-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ppc-wrap {
  font-family: var(--ppc-font);
  color: var(--ppc-text);
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  position: relative;
  box-sizing: border-box;
}

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

.ppc-header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.ppc-locked-course-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--ppc-bg);
  border: 1px solid var(--ppc-border);
  border-radius: var(--ppc-radius);
}

.ppc-locked-course-name {
  font-weight: 600;
  color: var(--ppc-text);
}

.ppc-locked-course-price {
  font-weight: 700;
  color: var(--ppc-primary);
  white-space: nowrap;
}

.ppc-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.ppc-subtitle {
  color: var(--ppc-muted);
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.ppc-back {
  background: none;
  border: none;
  color: var(--ppc-primary);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.ppc-back:hover {
  text-decoration: underline;
}

.ppc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 720px) {
  .ppc-grid {
    grid-template-columns: 1fr;
  }
}

.ppc-form-panel,
.ppc-summary-card {
  background: var(--ppc-card);
  border: 1px solid var(--ppc-border);
  border-radius: var(--ppc-radius);
  padding: 1.5rem;
  box-shadow: var(--ppc-shadow);
}

.ppc-field {
  margin-bottom: 1.25rem;
}

.ppc-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.ppc-field .req {
  color: var(--ppc-error);
}

.ppc-hint {
  font-weight: 400;
  color: var(--ppc-muted);
  font-size: 0.8rem;
  margin-left: 0.35rem;
}

.ppc-field select,
.ppc-field input[type="text"],
.ppc-field input[type="email"],
.ppc-field input[type="tel"],
.ppc-field input[type="number"],
.ppc-field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ppc-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ppc-field select:focus,
.ppc-field input:focus,
.ppc-field textarea:focus {
  outline: none;
  border-color: var(--ppc-primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.ppc-field select:disabled,
.ppc-field input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.ppc-input-group {
  display: flex;
  align-items: stretch;
}

.ppc-prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: #f1f5f9;
  border: 1px solid var(--ppc-border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-weight: 600;
  color: var(--ppc-muted);
}

.ppc-input-group input {
  border-radius: 0 8px 8px 0 !important;
  flex: 1;
}

.ppc-slider {
  width: 100%;
  margin-top: 0.6rem;
  accent-color: var(--ppc-primary);
}

.ppc-summary-card h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.ppc-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.45rem 0;
  font-size: 0.95rem;
}

.ppc-summary-row.highlight {
  background: #f0fdfa;
  margin: 0.75rem -0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 1.05rem;
}

.ppc-summary-row.highlight strong {
  color: var(--ppc-primary);
  font-size: 1.25rem;
}

.ppc-summary-row.subtle {
  color: var(--ppc-muted);
  font-size: 0.875rem;
}

.ppc-note {
  font-size: 0.8rem;
  color: var(--ppc-muted);
  margin: 0.75rem 0 1.25rem;
  line-height: 1.4;
}

.ppc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}

.ppc-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ppc-btn-primary {
  background: var(--ppc-primary);
  color: #fff;
  width: 100%;
}

.ppc-btn-primary:hover:not(:disabled) {
  background: var(--ppc-primary-hover);
}

.ppc-btn-block {
  width: 100%;
  margin-top: 1rem;
}

.ppc-secure-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ppc-muted);
  margin: 0.75rem 0 0;
}

.ppc-terms {
  margin-top: 1rem;
}

.ppc-checkbox {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.9rem;
  cursor: pointer;
}

.ppc-checkbox input {
  margin-top: 0.2rem;
  accent-color: var(--ppc-primary);
}

.ppc-terms-text {
  margin-top: 0.75rem;
  padding: 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--ppc-border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--ppc-muted);
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ppc-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--ppc-radius);
  z-index: 20;
}

.ppc-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ppc-border);
  border-top-color: var(--ppc-primary);
  border-radius: 50%;
  animation: ppc-spin 0.7s linear infinite;
  margin-bottom: 1rem;
}

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

.ppc-alert {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.ppc-alert.is-error {
  background: #fef2f2;
  color: var(--ppc-error);
  border: 1px solid #fecaca;
}

.ppc-alert.is-success {
  background: #f0fdf4;
  color: var(--ppc-success);
  border: 1px solid #bbf7d0;
}

.ppc-step[hidden] {
  display: none !important;
}

.sticky {
  position: sticky;
  top: 1rem;
}

hr {
  border: none;
  border-top: 1px solid var(--ppc-border);
  margin: 1rem 0;
}
