/* ==========================================================================
   Rally ATL — Global & Shared Stylesheet
   ==========================================================================
   Table of Contents:
   1. Imports & External Components
   2. Design Tokens & Global Reset
   3. Base Layout & Body
   4. Modal Component (BEM)
   5. Responsive Grid Pattern System (Mobile-First)
   6. Form Controls & Fieldsets
   7. Confirmation Screen
   8. Table Horizontal Scroll Container
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Imports & External Components
   -------------------------------------------------------------------------- */
@import url('elements.css');

/* --------------------------------------------------------------------------
   2. Design Tokens & Global Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green: #2ecc71;
  --green-d: #27ae60;
  --navy: #1a2e44;
  --navy-l: #243b55;
  --gold: #f1c40f;
  --gray: #f4f6f8;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --text: #2c3e50;
  --muted: #7f8c8d;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, .10);
}

/* --------------------------------------------------------------------------
   3. Base Layout & Body
   -------------------------------------------------------------------------- */
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--gray);
  color: var(--text);
  min-height: 100vh;
  box-sizing: border-box;
}




/* --------------------------------------------------------------------------
   4. Modal Component (BEM)
   Modal structure: overlay, modal, modal__header, modal__body, modal__footer
   -------------------------------------------------------------------------- */
.modal__overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal__overlay.modal--open {
  display: flex;
}

.modal {
  background: var(--white, #ffffff);
  border-radius: 16px;
  width: 100%;
  max-width: 820px;
  max-height: 96vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}

.modal.modal-small {
  max-width: 600px;
}

.modal__header {
  background: linear-gradient(135deg, var(--navy), var(--navy-l));
  color: var(--white);
  padding: 10px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.modal__header__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal__header a {
  color: var(--white, #ffffff);
  text-decoration: underline;
  margin-left: 5px;
}

.modal-coach {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
}

.modal-coach h2 {
  font-size: 20px;
  font-weight: 700;
}

.modal-coach p {
  font-size: 13px;
  color: #8fa8c0;
  margin-top: 3px;
}

.modal__btn-close {
  background: rgba(255, 255, 255, .15);
  border: none;
  color: var(--white, #ffffff);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}

.modal__btn-close:hover {
  background: rgba(255, 255, 255, .28);
}

/* Mobile-first: base padding 12px, enhanced to 18px at >=480px */
.modal__body {
  padding: 12px;
}

@media (min-width: 480px) {
  .modal__body {
    padding: 18px;
  }
}

.modal__footer {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border-light, #e2e8f0);
}

/* ── App Install Modal Component ── */
.install-modal {
  max-width: 440px;
}

.install-modal__app-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 14px;
}

.install-modal__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}

.install-modal__app-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--navy, #0f172a);
  margin: 0 0 2px;
  line-height: 1.2;
}

.install-modal__app-domain {
  font-size: 12px;
  color: var(--muted, #64748b);
  margin: 0;
}

.install-modal__features {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.install-modal__feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.install-modal__feature-item strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy, #0f172a);
  margin-bottom: 1px;
}

.install-modal__feature-item p {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.35;
}

.install-modal__feature-icon {
  font-size: 16px;
  background: var(--slate-100, #f1f5f9);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.install-modal__ios-guide {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
  font-size: 12.5px;
  color: #0369a1;
}

.install-modal__ios-guide ol {
  margin: 6px 0 0 18px;
  padding: 0;
}

.install-modal__ios-guide li {
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   5. Responsive Grid and Sectional Layouts Pattern System (Mobile-First)
   -------------------------------------------------------------------------- */
.grid-1,
.grid-2,
.grid-3,
.grid-4,
.grid-4-2,
.grid-6 {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.grid-4-2 {
  grid-template-columns: 1fr 1fr;
}

.grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* Colspan Helpers */
.colspan-1 {
  grid-column: span 1;
}

.colspan-2 {
  grid-column: span 2;
}

.colspan-3 {
  grid-column: span 3;
}

.colspan-4 {
  grid-column: span 4;
}

.colspan-5 {
  grid-column: span 5;
}

.colspan-6 {
  grid-column: span 6;
}

.colspan-full {
  grid-column: 1 / -1;
}

/* Fixed / Non-collapsing Grid Modifier */
.grid--fixed.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--fixed.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--fixed.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid--fixed.grid-6 {
  grid-template-columns: repeat(6, 1fr);
}

.grid--fixed>.colspan-1 {
  grid-column: span 1;
}

.grid--fixed>.colspan-2 {
  grid-column: span 2;
}

.grid--fixed>.colspan-3 {
  grid-column: span 3;
}

.grid--fixed>.colspan-4 {
  grid-column: span 4;
}

.grid--fixed>.colspan-5 {
  grid-column: span 5;
}

.grid--fixed>.colspan-6 {
  grid-column: span 6;
}

/* Pill Container for Chips / Badges */
.pill_container {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

/* Mobile-first: 480px Breakpoint */
@media (min-width: 480px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .colspan-2 {
    grid-column: span 2;
  }

  .colspan-3 {
    grid-column: span 2;
  }
}

/* Mobile-first: 640px Breakpoint */
@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4-2 {
    grid-template-columns: repeat(4, 1fr);
  }

  .colspan-3 {
    grid-column: span 3;
  }
}

/* --------------------------------------------------------------------------
   6. Form Controls & Fieldsets
   -------------------------------------------------------------------------- */
.form-section {
  grid-column: 1 / -1;
}

/* Mobile-first: 1 column by default, 2 columns at >=480px */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

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

fieldset {
  margin-bottom: 12px;
  border-radius: 2px;
  padding: 12px;
  border: 1px solid var(--border);
}

legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.input-group.input-full,
.input-full {
  grid-column: 1 / -1;
}

.input-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy, #0f172a);
  display: block;
}

.input-group :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border .18s, box-shadow .18s;
  background: var(--white);
  color: var(--navy, #0f172a);
  box-sizing: border-box;
}

.input-group :is(input:not([type="checkbox"], [type="radio"]), select, textarea):focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
}

.input-group :is(input:not([type="checkbox"], [type="radio"]), select, textarea):disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: var(--border-light);
  opacity: 0.75;
}

.input-group textarea {
  resize: vertical;
  min-height: 70px;
}

/* --------------------------------------------------------------------------
   7. Confirmation Screen
   -------------------------------------------------------------------------- */
.confirm-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px;
  text-align: center;
}

.confirm-screen.show {
  display: flex;
}

.confirm-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.confirm-screen h2 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--navy);
}

.confirm-screen p {
  color: var(--muted);
  font-size: 15px;
  max-width: 380px;
  line-height: 1.6;
}

.confirm-details {
  background: var(--gray);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
  width: 100%;
  max-width: 380px;
  text-align: left;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid #e8edf2;
}

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-row .key {
  color: var(--muted);
}

.confirm-row .val {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   8. Table Scroll Container
   -------------------------------------------------------------------------- */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 2px solid #f4f4f4;
}

table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

@media screen and (min-width: 640px) {
  .table-scroll {
    overflow: auto;
  }
}