/* =====================================================
   TERMS AND CONDITIONS DIALOG — terms-dialog.css

   ALIGNMENT STRATEGY:
   Instead of fighting AM's padding on md-toolbar-tools
   and md-dialog-content separately, we:
   1. Zero out ALL AM padding at the element level
   2. Own ALL horizontal spacing via a single CSS variable
      --dlg-pad applied to inner wrapper elements
   This guarantees toolbar icon and contact icon share
   exactly the same left origin, regardless of AM version.
   ===================================================== */

/* ── Single source of truth for horizontal spacing ── */
.terms-dialog {
  --dlg-pad: 20px;

  width: 860px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}

/* ════════════════════════════════
   TOOLBAR
   ════════════════════════════════ */
.terms-toolbar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  min-height: 68px !important;
  flex-shrink: 0 !important;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
  /* Zero AM's own padding on the toolbar element */
  padding: 0 !important;
}

/*
  Zero AM's padding on .md-toolbar-tools completely.
  The inline style in HTML also sets padding:0 !important as backup.
  All spacing comes from .terms-toolbar-inner below.
*/
.terms-toolbar .md-toolbar-tools {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 68px !important;
}

/*
  .terms-toolbar-inner is our own flex container that lives INSIDE
  .md-toolbar-tools. We control its padding — AM can't touch it.
  This is the SAME left edge as .terms-content below.
*/
.terms-toolbar-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px;
  width: 100%;
  padding: 0 var(--dlg-pad);
}

/* .terms-toolbar-spacer removed */

.terms-toolbar-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.terms-toolbar-icon md-icon {
  color: white !important;
  font-size: 22px !important; width: 22px !important; height: 22px !important;
}

.terms-toolbar-text {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 0; text-align: left !important;
}
.terms-toolbar-text h2 {
  margin: 0; font-size: 17px; font-weight: 700;
  color: white; line-height: 1.2; text-align: left !important;
}
.terms-toolbar-text span {
  font-size: 12px; color: rgba(255,255,255,0.72); font-weight: 400;
  text-align: left !important;
}

.terms-toolbar .md-icon-button { color: rgba(255,255,255,0.9) !important; margin: 0 !important; }
.terms-toolbar .md-icon-button:hover { background: rgba(255,255,255,0.12) !important; }

/* ════════════════════════════════
   CONTENT
   Uses the same --dlg-pad as the toolbar inner wrapper,
   guaranteeing identical left alignment.

   Specificity (0,2,2) beats styles.css (0,2,1) for padding-top.
   ════════════════════════════════ */
md-dialog.terms-dialog md-dialog-content.terms-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px var(--dlg-pad) 28px !important;
  background: #f8f9ff;
  font-size: 15px;
  line-height: 1.7;
  text-align: left !important;
}

/* Beat styles.css first-child rule (0,1,2) → our (0,3,2) wins */
md-dialog.terms-dialog md-dialog-content.terms-content > .terms-intro {
  margin-top: 0 !important;
  padding: 14px 20px !important;
}

md-dialog.terms-dialog md-dialog-content.terms-content::-webkit-scrollbar { width: 6px; }
md-dialog.terms-dialog md-dialog-content.terms-content::-webkit-scrollbar-thumb { background: #d0d5e8; border-radius: 3px; }

/* ── Intro banner ── */
.terms-intro {
  background: linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.08) 100%);
  border-left: 4px solid #667eea;
  border-radius: 0 8px 8px 0;
  font-size: 15px;
  color: #4a5568;
  line-height: 1.6;
  font-style: italic;
}

/* ── Sections ── */
.terms-section {
  padding: 28px 0 0 0;
  background: transparent;
}

.terms-section + .terms-section {
  border-top: 1px solid #dde1f0;
  margin-top: 24px;
}

.terms-section-title {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: #2d3748;
  line-height: 1.3;
}

.terms-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: 10px;
}

.terms-section p {
  margin: 0 0 10px;
  font-size: 15px;
  color: #4a5568;
  line-height: 1.7;
}
.terms-section p:last-child { margin-bottom: 0; }

.terms-list {
  margin: 8px 0 0 0;
  padding-left: 20px;
  font-size: 15px;
  color: #4a5568;
  line-height: 1.8;
}
.terms-list li { margin-bottom: 6px; }

/* ── Contact footer ── */
/*
  padding: 0 on both sides — inherits left alignment from
  the content's var(--dlg-pad) padding, same as toolbar inner.
  Icon left edge = content left edge = toolbar inner left edge. ✓
*/
.terms-contact {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
  gap: 10px;
  padding: 20px 0 4px 0;
  margin-top: 28px;
  border-top: 1px solid #dde1f0;
}
.terms-contact md-icon {
  color: #667eea !important;
  font-size: 20px !important; width: 20px !important; height: 20px !important;
  flex-shrink: 0;
}
.terms-contact span { font-size: 14px; color: #2c5282; line-height: 1.4; text-align: left !important; }
.terms-contact strong { color: #667eea; }

/* ── Footer actions ── */
.terms-actions {
  padding: 14px 20px !important;
  border-top: 1px solid #eaecf5 !important;
  background: white !important;
  min-height: 60px !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

.terms-btn-close {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  height: 40px !important;
  border-radius: 20px !important;
  padding: 0 24px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-transform: none !important;
  margin: 0 !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(102,126,234,0.3) !important;
  transition: all 0.2s ease !important;
}
.terms-btn-close:hover {
  box-shadow: 0 4px 14px rgba(102,126,234,0.45) !important;
  transform: translateY(-1px);
}
.terms-btn-close md-icon {
  font-size: 17px !important; width: 17px !important;
  height: 17px !important; color: white !important;
}
/* ── Section 13: SMS disclosure ── */
.terms-section--sms {
    border-left: 4px solid #1976d2;
    padding-left: 16px;
}
.terms-sms-badge {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #e3f2fd;
    border-radius: 6px;
    padding: 12px 14px;
    margin-top: 14px;
}
.terms-sms-badge md-icon {
    color: #1565c0 !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
    margin-top: 1px;
}
.terms-sms-badge span {
    font-size: 12px;
    color: #1565c0;
    line-height: 1.5;
    font-style: italic;
}