/* social-run/assets/style.css */
/* Mobile-first, premium design untuk minisite social-run.bhawikarsurunners.com */

/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  /* Brand */
  --brand-primary:   #f97316;  /* orange energik */
  --brand-dark:      #c2410c;
  --brand-light:     #fed7aa;
  --brand-gradient:  linear-gradient(135deg, #f97316 0%, #ea580c 50%, #dc2626 100%);

  /* Neutrals */
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-300:  #d1d5db;
  --gray-400:  #9ca3af;
  --gray-500:  #6b7280;
  --gray-600:  #4b5563;
  --gray-700:  #374151;
  --gray-800:  #1f2937;
  --gray-900:  #111827;

  /* Semantic */
  --color-success:  #16a34a;
  --color-error:    #dc2626;
  --color-warning:  #d97706;
  --color-info:     #2563eb;

  /* Surfaces */
  --surface-bg:     #fff;
  --surface-card:   #fff;
  --surface-subtle: #fafafa;

  /* Typography */
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm:  0.375rem;
  --radius-md:  0.75rem;
  --radius-lg:  1rem;
  --radius-xl:  1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;

  --max-width: 680px;
  accent-color: var(--brand-primary);
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-100);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--brand-dark); text-decoration: underline; }

/* =========================================================
   NAVBAR
   ========================================================= */
.sr-nav {
  background: #fff;
  border-bottom: 2px solid var(--brand-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.sr-nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.sr-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: inherit;
}
.sr-nav__brand:hover { text-decoration: none; }

.sr-nav__logo {
  font-size: var(--text-xl);
  line-height: 1;
}

.sr-nav__title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--brand-primary);
  white-space: nowrap;
}

.sr-nav__sub {
  font-size: var(--text-xs);
  color: var(--gray-500);
  display: none; /* hide on mobile, show on wider */
}

@media (min-width: 480px) {
  .sr-nav__sub { display: inline; }
}

.sr-nav__member {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.sr-nav__member-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--brand-light);
  color: var(--brand-dark);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sr-nav__member-name {
  font-size: var(--text-xs);
  color: var(--gray-600);
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.sr-main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-4);
}

@media (min-width: 640px) {
  .sr-main { padding: var(--space-8) var(--space-6); }
}

/* =========================================================
   HERO
   ========================================================= */
.sr-hero {
  background: var(--brand-gradient);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: #fff;
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}

.sr-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.sr-hero__label {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.sr-hero__title {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--space-3);
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sr-hero__date {
  font-size: var(--text-base);
  opacity: 0.9;
  margin-bottom: var(--space-2);
}

.sr-hero__location {
  font-size: var(--text-sm);
  opacity: 0.8;
}

/* =========================================================
   MEMBER PREFILL BANNER
   ========================================================= */
.sr-member-banner {
  background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
  border: 1px solid #93c5fd;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.sr-member-banner__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.sr-member-banner__title {
  font-weight: 700;
  color: #1e40af;
  font-size: var(--text-sm);
  margin-bottom: var(--space-1);
}

.sr-member-banner__text {
  font-size: var(--text-sm);
  color: #1e40af;
  line-height: 1.5;
}

/* =========================================================
   CARD
   ========================================================= */
.sr-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-4);
}

.sr-card__title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--gray-100);
}

/* =========================================================
   PRICE OPTIONS
   ========================================================= */
.sr-price-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-4);
}

@media (min-width: 480px) {
  .sr-price-grid { grid-template-columns: repeat(2, 1fr); }
}

.sr-price-option {
  position: relative;
}

.sr-price-option input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
  margin: 0;
}

.sr-price-option__card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: border-color var(--transition-base), box-shadow var(--transition-base), background var(--transition-base);
  background: #fff;
  position: relative;
  overflow: hidden;
}

.sr-price-option__card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 0 var(--radius-md) 0 var(--radius-full);
  background: var(--brand-primary);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sr-price-option__card::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.sr-price-option input[type="radio"]:checked + .sr-price-option__card {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-light);
  background: #fff7f0;
}

.sr-price-option input[type="radio"]:checked + .sr-price-option__card::before,
.sr-price-option input[type="radio"]:checked + .sr-price-option__card::after {
  opacity: 1;
}

.sr-price-option__label {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--gray-800);
  margin-bottom: var(--space-1);
}

.sr-price-option__price {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--brand-primary);
  margin-bottom: var(--space-1);
}

.sr-price-option__price-normal {
  font-size: var(--text-xs);
  color: var(--gray-400);
  text-decoration: line-through;
}

.sr-price-option__badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.sr-price-option__includes {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

.sr-price-option--soldout .sr-price-option__card {
  background: var(--gray-50);
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================================================
   STEPS INDICATOR
   ========================================================= */
.sr-steps {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  align-items: center;
}

.sr-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.sr-step__num {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--gray-200);
  color: var(--gray-500);
  font-size: var(--text-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition-base), color var(--transition-base);
}

.sr-step__label {
  font-size: var(--text-xs);
  color: var(--gray-400);
  font-weight: 500;
  display: none;
}

@media (min-width: 440px) {
  .sr-step__label { display: block; }
}

.sr-step__connector {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  transition: background var(--transition-base);
}

.sr-step--active .sr-step__num {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 0 0 3px var(--brand-light);
}
.sr-step--active .sr-step__label { color: var(--brand-primary); font-weight: 600; }

.sr-step--done .sr-step__num {
  background: var(--color-success);
  color: #fff;
}
.sr-step--done .sr-step__label { color: var(--color-success); }
.sr-step--done + .sr-step .sr-step__connector { background: var(--color-success); }

/* =========================================================
   FORM ELEMENTS
   ========================================================= */
.sr-form-group {
  margin-bottom: var(--space-5);
}

.sr-form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}

.sr-form-label .required {
  color: var(--color-error);
  margin-left: var(--space-1);
}

.sr-form-hint {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: var(--space-1);
}

.sr-input,
.sr-select,
.sr-textarea {
  display: block;
  width: 100%;
  font-family: var(--font-base);
  font-size: var(--text-base);
  color: var(--gray-900);
  background: #fff;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.5;
}

.sr-input::placeholder { color: var(--gray-400); }

.sr-input:focus,
.sr-select:focus,
.sr-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-light);
}

.sr-input--prefilled {
  background: #f0fdf4;
  border-color: #86efac;
  color: #14532d;
}

.sr-input--error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px #fecaca;
}

.sr-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.5rem;
}

/* Radio group for gender etc */
.sr-radio-group {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.sr-radio-option {
  flex: 1;
  min-width: 100px;
  position: relative;
}

.sr-radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
  margin: 0;
}

.sr-radio-option__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  background: #fff;
  white-space: nowrap;
}

.sr-radio-option input[type="radio"]:checked + .sr-radio-option__label {
  border-color: var(--brand-primary);
  background: #fff7f0;
  color: var(--brand-dark);
  font-weight: 600;
}

/* Form error message */
.sr-form-error {
  font-size: var(--text-sm);
  color: var(--color-error);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Jersey section - hidden/shown by JS */
.sr-jersey-section {
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.sr-jersey-section--hidden { display: none; }

/* =========================================================
   BUTTONS
   ========================================================= */
.sr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.sr-btn:focus-visible {
  outline: 3px solid var(--brand-light);
  outline-offset: 2px;
}

.sr-btn--primary {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(249,115,22,0.4);
}

.sr-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.5);
  color: #fff;
  text-decoration: none;
}

.sr-btn--primary:active { transform: translateY(0); }

.sr-btn--secondary {
  background: #fff;
  color: var(--gray-700);
  border-color: var(--gray-300);
}
.sr-btn--secondary:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-800); text-decoration: none; }

.sr-btn--block { width: 100%; }
.sr-btn--lg { padding: 1rem 2rem; font-size: var(--text-lg); }

.sr-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* =========================================================
   BUTTON GROUP (prev / next)
   ========================================================= */
.sr-btn-group {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.sr-btn-group > * { flex: 1; }

/* =========================================================
   ALERT / NOTICE
   ========================================================= */
.sr-alert {
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.sr-alert__icon { font-size: 1.125rem; flex-shrink: 0; line-height: 1.4; }
.sr-alert__content { flex: 1; }
.sr-alert__title { font-weight: 700; margin-bottom: var(--space-1); }

.sr-alert--error   { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.sr-alert--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.sr-alert--info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.sr-alert--warning { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }

/* =========================================================
   SUCCESS / TOKEN DISPLAY
   ========================================================= */
.sr-success-hero {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.sr-success-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto var(--space-4);
  box-shadow: 0 0 0 8px #f0fdf4;
}

.sr-success-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-success);
  margin-bottom: var(--space-2);
}

.sr-success-subtitle {
  color: var(--gray-500);
  font-size: var(--text-base);
}

.sr-token-box {
  background: var(--gray-900);
  color: #a3e635;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 0.15em;
  word-break: break-all;
  margin: var(--space-4) 0;
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast);
}
.sr-token-box:hover { background: var(--gray-800); }
.sr-token-box::after {
  content: 'Tap untuk copy';
  display: block;
  font-family: var(--font-base);
  font-size: var(--text-xs);
  color: var(--gray-500);
  letter-spacing: 0;
  margin-top: var(--space-2);
  font-weight: 400;
}

/* =========================================================
   SUMMARY TABLE
   ========================================================= */
.sr-summary {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}

.sr-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: var(--text-sm);
}

.sr-summary__row:last-child { border-bottom: none; }

.sr-summary__key {
  color: var(--gray-500);
  flex-shrink: 0;
}

.sr-summary__val {
  font-weight: 600;
  color: var(--gray-800);
  text-align: right;
  overflow-wrap: anywhere;
  min-width: 0;
  word-break: break-all;
}

.sr-summary__total .sr-summary__key { font-weight: 700; color: var(--gray-800); }
.sr-summary__total .sr-summary__val { font-size: var(--text-lg); color: var(--brand-primary); }

/* =========================================================
   STATUS BADGE
   ========================================================= */
.sr-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sr-badge--pending   { background: #fef3c7; color: #92400e; }
.sr-badge--confirmed { background: #dcfce7; color: #14532d; }
.sr-badge--cancelled { background: #f3f4f6; color: #6b7280; }
.sr-badge--paid      { background: #dcfce7; color: #14532d; }
.sr-badge--unpaid    { background: #fef3c7; color: #92400e; }
.sr-badge--waived    { background: #ede9fe; color: #4c1d95; }

/* =========================================================
   FOOTER
   ========================================================= */
.sr-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  margin-top: var(--space-12);
}

.sr-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-4);
  text-align: center;
}

.sr-footer__text {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
}

.sr-footer__text strong { color: var(--gray-200); }

.sr-footer__links {
  font-size: var(--text-sm);
}

.sr-footer__links a {
  color: var(--gray-400);
  transition: color var(--transition-fast);
}

.sr-footer__links a:hover { color: #fff; }

/* =========================================================
   UTILITIES
   ========================================================= */
.text-center { text-align: center; }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.text-muted  { color: var(--gray-500); }
.fw-bold     { font-weight: 700; }
.mt-4        { margin-top: var(--space-4); }
.mt-6        { margin-top: var(--space-6); }
.mb-4        { margin-bottom: var(--space-4); }

/* Divider */
.sr-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: var(--space-6) 0;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sr-card,
.sr-hero,
.sr-member-banner,
.sr-alert {
  animation: fadeInUp 0.35s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
  .sr-card, .sr-hero, .sr-member-banner, .sr-alert {
    animation: none;
  }
}
