/* =========================================================
   Hays Chemist Prescription Manager — Frontend Styles
   ========================================================= */

:root {
  --hc-primary:     #1a6f4c;
  --hc-primary-dk:  #155c3e;
  --hc-primary-lt:  #e8f5ee;
  --hc-accent:      #2ecc71;
  --hc-danger:      #e74c3c;
  --hc-warning:     #f39c12;
  --hc-info:        #3498db;
  --hc-border:      #dee2e6;
  --hc-bg:          #f8f9fa;
  --hc-text:        #2c3e50;
  --hc-text-muted:  #6c757d;
  --hc-radius:      10px;
  --hc-shadow:      0 2px 12px rgba(0,0,0,.08);
  --hc-transition:  all .2s ease;
}

/* ─── Base ─── */
.hc-auth-wrap,
.hc-patient-wrap,
.hc-rx-wrap,
.hc-how-to-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--hc-text);
  max-width: 800px;
  margin: 0 auto;
}

/* ─── Buttons ─── */
.hc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--hc-transition);
  line-height: 1;
}
.hc-btn-primary {
  background: var(--hc-primary);
  color: #fff !important;
  border-color: var(--hc-primary);
}
.hc-btn-primary:hover {
  background: var(--hc-primary-dk);
  border-color: var(--hc-primary-dk);
  color: #fff !important;
  text-decoration: none;
}
.hc-btn-outline {
  background: transparent;
  color: var(--hc-primary) !important;
  border-color: var(--hc-primary);
}
.hc-btn-outline:hover {
  background: var(--hc-primary-lt);
  text-decoration: none;
}
.hc-btn-danger {
  background: transparent;
  color: var(--hc-danger) !important;
  border-color: var(--hc-danger);
}
.hc-btn-danger:hover {
  background: #fdf2f2;
}
.hc-btn-sm  { padding: 6px 14px; font-size: .82rem; }
.hc-btn-lg  { padding: 14px 32px; font-size: 1rem; }
.hc-link-btn {
  background: none;
  border: none;
  color: var(--hc-primary);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

/* ─── Tabs ─── */
.hc-tabs {
  display: flex;
  border-bottom: 2px solid var(--hc-border);
  margin-bottom: 28px;
}
.hc-tab-btn {
  padding: 12px 28px;
  border: none;
  background: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--hc-text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--hc-transition);
}
.hc-tab-btn.active,
.hc-tab-btn:hover {
  color: var(--hc-primary);
  border-bottom-color: var(--hc-primary);
}
.hc-tab-panel { display: none; }
.hc-tab-panel.active { display: block; }

/* ─── Form fields ─── */
.hc-field {
  margin-bottom: 18px;
}
.hc-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: .92rem;
  color: var(--hc-text);
}
.hc-field input[type="text"],
.hc-field input[type="email"],
.hc-field input[type="tel"],
.hc-field input[type="password"],
.hc-field input[type="date"],
.hc-field select,
.hc-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--hc-border);
  border-radius: 6px;
  font-size: .95rem;
  color: var(--hc-text);
  background: #fff;
  transition: var(--hc-transition);
  box-sizing: border-box;
}
.hc-field input:focus,
.hc-field select:focus,
.hc-field textarea:focus {
  border-color: var(--hc-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,111,76,.12);
}
.hc-field-hint {
  font-size: .8rem;
  color: var(--hc-text-muted);
  margin-top: 4px;
}
.hc-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .hc-field-row { grid-template-columns: 1fr; }
}
.hc-field-check label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}
.hc-field-check input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--hc-primary);
}
.req { color: var(--hc-danger); }

/* Password toggle */
.hc-pass-wrap {
  position: relative;
}
.hc-pass-wrap input {
  padding-right: 44px;
}
.hc-toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--hc-text-muted);
  padding: 0;
}
.hc-forgot-link {
  text-align: right;
  margin: -8px 0 14px;
  font-size: .85rem;
}
.hc-forgot-link a { color: var(--hc-primary); }

/* ─── Form messages ─── */
.hc-form-msg {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: .92rem;
  font-weight: 500;
}
.hc-form-msg.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.hc-form-msg.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.hc-form-msg.info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ─── Notices ─── */
.hc-notice {
  padding: 12px 18px;
  border-radius: 8px;
  border-left: 4px solid;
  margin-bottom: 20px;
  font-size: .93rem;
}
.hc-notice-info    { background: #e8f4fd; border-color: var(--hc-info);    color: #1a4f7a; }
.hc-notice-warning { background: #fef9e7; border-color: var(--hc-warning); color: #7d5a00; }
.hc-notice-success { background: #e8f8ef; border-color: var(--hc-accent);  color: #155724; }

/* ─── Radio groups ─── */
.hc-radio-group {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.hc-radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 400;
  cursor: pointer;
}
.hc-radio-group input { accent-color: var(--hc-primary); }

/* ─── Logged-in state ─── */
.hc-auth-logged-in {
  padding: 20px;
  background: var(--hc-primary-lt);
  border: 1px solid var(--hc-accent);
  border-radius: var(--hc-radius);
}

/* ─── Patient profiles grid ─── */
.hc-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.hc-profile-card {
  background: #fff;
  border: 2px solid var(--hc-border);
  border-radius: var(--hc-radius);
  padding: 20px 16px;
  text-align: center;
  transition: var(--hc-transition);
  box-shadow: var(--hc-shadow);
}
.hc-profile-card:hover {
  border-color: var(--hc-primary);
  box-shadow: 0 4px 18px rgba(26,111,76,.12);
}
.hc-profile-avatar { font-size: 2.5rem; margin-bottom: 10px; }
.hc-profile-card h4 { margin: 0 0 4px; font-size: 1rem; }
.hc-profile-card p  { margin: 0 0 12px; font-size: .85rem; color: var(--hc-text-muted); }
.hc-profile-species {
  display: inline-block;
  background: #e0f5e9;
  color: var(--hc-primary);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.hc-profile-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ─── Section headings ─── */
.hc-section { margin-bottom: 40px; }
.hc-section > h3 {
  font-size: 1.15rem;
  color: var(--hc-primary);
  border-bottom: 2px solid var(--hc-primary-lt);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
.hc-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

/* ─── Prescription form ─── */
.hc-rx-wrap { max-width: 760px; }
.hc-rx-step {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
}
.hc-rx-step-num {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: var(--hc-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 2px;
}
.hc-rx-step-body { flex: 1; }
.hc-rx-step-body h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--hc-text);
}

/* Prescription type cards */
.hc-rx-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.hc-rx-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 20px 14px;
  border: 2px solid var(--hc-border);
  border-radius: var(--hc-radius);
  cursor: pointer;
  transition: var(--hc-transition);
  background: #fff;
}
.hc-rx-type-card input[type="radio"] { display: none; }
.hc-rx-type-card.selected,
.hc-rx-type-card:has(input:checked) {
  border-color: var(--hc-primary);
  background: var(--hc-primary-lt);
}
.hc-rx-type-card:hover { border-color: var(--hc-primary); }
.hc-rxtc-icon { font-size: 2rem; }
.hc-rx-type-card strong { font-size: .95rem; color: var(--hc-text); }
.hc-rx-type-card p { font-size: .78rem; color: var(--hc-text-muted); margin: 0; }

/* Profile select at Rx form */
.hc-profile-select-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.hc-profile-select-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--hc-border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--hc-transition);
  background: #fff;
}
.hc-profile-select-card input[type="radio"] { accent-color: var(--hc-primary); }
.hc-profile-select-card:has(input:checked) {
  border-color: var(--hc-primary);
  background: var(--hc-primary-lt);
}
.hc-psc-icon { font-size: 1.4rem; }

/* File upload area */
.hc-file-upload-area {
  border: 2px dashed var(--hc-border);
  border-radius: var(--hc-radius);
  padding: 32px 20px;
  text-align: center;
  background: var(--hc-bg);
  transition: var(--hc-transition);
  cursor: pointer;
}
.hc-file-upload-area:hover,
.hc-file-upload-area.drag-over {
  border-color: var(--hc-primary);
  background: var(--hc-primary-lt);
}
.hc-file-placeholder span { font-size: 2.5rem; display: block; margin-bottom: 10px; }
.hc-file-placeholder p { margin: 0 0 6px; font-weight: 500; }
.hc-file-placeholder small { color: var(--hc-text-muted); }
.hc-file-preview {
  padding: 12px;
  background: #e8f5ee;
  border-radius: 6px;
  font-size: .9rem;
  color: var(--hc-primary);
  font-weight: 600;
}

/* ─── How to Order steps ─── */
.hc-how-to-wrap { max-width: 700px; }
.hc-section-title {
  font-size: 1.6rem;
  color: var(--hc-primary);
  margin-bottom: 28px;
}
.hc-steps { position: relative; }
.hc-step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 8px;
  position: relative;
}
.hc-step-circle {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: var(--hc-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(26,111,76,.3);
}
.hc-step-connector {
  position: absolute;
  left: 21px;
  top: 44px;
  width: 2px;
  height: calc(100% + 8px);
  background: var(--hc-primary-lt);
  z-index: 0;
}
.hc-step:last-child .hc-step-connector { display: none; }
.hc-step-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0 24px;
  flex: 1;
}
.hc-step-icon { font-size: 1.6rem; min-width: 36px; }
.hc-step-content h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--hc-text);
}
.hc-step-content p {
  margin: 0;
  color: var(--hc-text-muted);
  font-size: .88rem;
}

/* Rx info cards */
.hc-rx-info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 600px) {
  .hc-rx-info-cards { grid-template-columns: 1fr; }
}
.hc-rx-info-card {
  background: #fff;
  border: 1.5px solid var(--hc-border);
  border-radius: var(--hc-radius);
  padding: 22px 20px;
  box-shadow: var(--hc-shadow);
}
.hc-rx-info-icon { font-size: 2rem; display: block; margin-bottom: 10px; }
.hc-rx-info-card h4 { margin: 0 0 10px; color: var(--hc-primary); }
.hc-rx-info-card p  { margin: 0 0 10px; font-size: .88rem; color: var(--hc-text-muted); line-height: 1.6; }
.hc-postal-address {
  background: var(--hc-bg);
  border: 1px solid var(--hc-border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: .85rem;
  line-height: 1.6;
}
.hc-divider { border: none; border-top: 1px solid var(--hc-border); margin: 28px 0; }

/* ─── WooCommerce Checkout sections ─── */
.hc-checkout-section {
  margin: 28px 0;
  padding: 24px;
  background: #fff;
  border: 2px solid var(--hc-primary-lt);
  border-radius: var(--hc-radius);
  box-shadow: var(--hc-shadow);
}
.hc-checkout-section h3 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  color: var(--hc-primary);
}
.hc-checkout-note {
  color: var(--hc-text-muted);
  font-size: .88rem;
  margin: 0 0 18px;
}
.hc-checkout-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--hc-border);
  border-radius: 6px;
  font-size: .95rem;
  background: #fff;
}
.hc-checkout-rx-types {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.hc-checkout-rx-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 2px solid var(--hc-border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--hc-transition);
  background: var(--hc-bg);
}
.hc-checkout-rx-option:has(input:checked) {
  border-color: var(--hc-primary);
  background: var(--hc-primary-lt);
}
.hc-checkout-rx-option input[type="radio"] { accent-color: var(--hc-primary); }
.hc-co-icon { font-size: 1.5rem; }
.hc-checkout-rx-option strong { display: block; font-size: .95rem; }
.hc-checkout-rx-option small { color: var(--hc-text-muted); font-size: .8rem; }
.hc-co-sub-fields {
  margin-top: 14px;
  padding: 16px;
  background: var(--hc-bg);
  border-radius: 8px;
  border: 1px solid var(--hc-border);
}
.hc-co-sub-fields label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: 6px;
}
.hc-co-upload-area { margin-top: 8px; }
.hc-co-upload-btn { font-size: .9rem !important; }
.hc-paper-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .hc-paper-options { grid-template-columns: 1fr; } }
.hc-paper-option { padding: 14px; background: #fff; border: 1px solid var(--hc-border); border-radius: 8px; }
.hc-paper-option strong { font-size: .92rem; }
.hc-checkout-info-box {
  padding: 12px 16px;
  background: var(--hc-primary-lt);
  border: 1px solid #a8d5be;
  border-radius: 6px;
  font-size: .9rem;
  color: #1a5c3a;
}

/* ─── Loading spinner ─── */
.hc-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hc-spin .6s linear infinite;
  vertical-align: middle;
}
.hc-spinner-dark {
  border-color: rgba(26,111,76,.3);
  border-top-color: var(--hc-primary);
}
@keyframes hc-spin { to { transform: rotate(360deg); } }
