/* Comp Race Signup Form — standalone page styles */

[x-cloak] {
  display: none !important;
}

:root {
  --crf-primary: #006687;
  --crf-primary-dark: #004f67;
  --crf-success: #198754;
  --crf-text: #212529;
  --crf-muted: #6c757d;
  --crf-border: #dee2e6;
  --crf-bg: #f4f6f9;
  --crf-card-bg: #ffffff;
  --crf-header-bg: linear-gradient(135deg, #006687 0%, #004f67 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--crf-bg);
  color: var(--crf-text);
  min-height: 100vh;
}

body.crf-has-banner {
  background-size: cover;
  background-position: top;
  background-attachment: fixed;
}

body.crf-has-banner .crf-page {
  background: rgba(0, 0, 0, 0.45);
  min-height: 100vh;
}

body.crf-has-banner .crf-body {
  background: transparent;
}

body.crf-has-banner .crf-header {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

body.crf-has-banner .crf-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.crf-has-banner .crf-footer {
  background: rgba(0, 0, 0, 0.3);
  border-top-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
}

body.crf-has-banner .crf-footer a {
  color: rgba(255, 255, 255, 0.85);
}

/* Page layout */
.crf-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.crf-header {
  background: var(--crf-header-bg);
  color: #fff;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  position: relative;
}

.crf-user-bar {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.85;
}

.crf-user-bar-logout {
  color: #fff;
  opacity: 0.75;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  padding: 0.15em 0.55em;
  font-size: 0.9em;
  transition: opacity 0.15s;
}

.crf-user-bar-logout:hover {
  opacity: 1;
  color: #fff;
}

.crf-logo {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 1rem;
}

.crf-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
  line-height: 1.2;
}

.crf-race-info {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.crf-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 0.15em 0.7em;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-left: 0.4em;
  vertical-align: middle;
}

.crf-description {
  margin: 0.8rem auto 0;
  max-width: 560px;
  opacity: 0.85;
  font-size: 0.95rem;
  line-height: 1.5;
}

.crf-deadline {
  margin: 0.6rem auto 0;
  max-width: 560px;
  font-size: 0.85rem;
  opacity: 0.8;
  font-style: italic;
}

/* Body */
.crf-body {
  flex: 1;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Card */
.crf-card {
  background: var(--crf-card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  margin-bottom: 1.5rem;
}

.crf-card.crf-closed,
.crf-card.crf-success {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--crf-muted);
}

.crf-card.crf-success {
  color: var(--crf-success);
}

.crf-card.crf-closed i,
.crf-card.crf-success i {
  display: block;
  margin-bottom: 1rem;
}

.crf-card.crf-closed h2,
.crf-card.crf-success h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

/* Section title */
.crf-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--crf-primary);
}

/* Primary button */
.crf-btn-primary {
  background: var(--crf-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  transition: background 0.2s ease;
}

.crf-btn-primary:hover:not(:disabled) {
  background: var(--crf-primary-dark);
  color: #fff;
}

.crf-btn-primary:disabled {
  opacity: 0.65;
}

/* Result info panel */
.crf-result-info {
  background: #f0f7fa;
  border: 1px solid #c8e0eb;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-top: 0.6rem;
}

.crf-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--crf-muted);
  margin-bottom: 0.15rem;
}

.crf-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--crf-primary);
}

/* Submitted summary */
.crf-submitted-summary {
  text-align: left;
  background: #f0f7fa;
  border: 1px solid #c8e0eb;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  line-height: 2;
  color: var(--crf-text);
}

.crf-submitted-summary .crf-stat-label {
  display: inline;
  font-size: inherit;
}

/* Form controls */
.form-control:focus,
.form-select:focus {
  border-color: var(--crf-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 102, 135, 0.2);
}

/* Recent results dropdown */
.crf-result-select {
  font-size: 0.92rem;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  border-radius: 8px;
  border-color: var(--crf-border);
  background-color: #fff;
  cursor: pointer;
}

.crf-result-select option {
  padding: 6px 4px;
  line-height: 1.5;
}

.crf-result-select option[value=""] {
  color: var(--crf-muted);
  font-style: italic;
}

.crf-result-select option.crf-option-manual,
.crf-result-select option[value="__manual__"] {
  color: var(--crf-primary);
  font-weight: 600;
  border-top: 1px solid var(--crf-border);
}

/* Footer */
.crf-footer {
  text-align: center;
  padding: 1.2rem;
  font-size: 0.8rem;
  color: var(--crf-muted);
  border-top: 1px solid var(--crf-border);
}

.crf-footer a {
  color: var(--crf-primary);
  text-decoration: none;
}

.crf-footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 576px) {
  .crf-header {
    padding: 2rem 1rem 1.5rem;
  }

  .crf-title {
    font-size: 1.4rem;
  }

  .crf-card {
    padding: 1.4rem 1.2rem;
  }
}