/* Material Design 3 (M3) Typography & Colors */
:root {
  --md-sys-color-primary: #1a73e8;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d3e3fd;
  --md-sys-color-on-primary-container: #041e49;
  --md-sys-color-secondary-container: #e8f0fe;
  --md-sys-color-on-secondary-container: #1967d2;
  --md-sys-color-surface: #f8f9fa;
  --md-sys-color-on-surface: #1f1f1f;
  --md-sys-color-on-surface-variant: #5f6368;
  --md-sys-color-outline-variant: #e0e0e0;
  --md-sys-color-surface-container: #f0f4f8;
  --md-sys-color-surface-container-low: #f7f9fc;
  --md-sys-color-text-secondary: #70757a;
}

body {
  font-family: 'Roboto', 'Google Sans Text', Arial, sans-serif;
  color: var(--md-sys-color-on-surface);
  background-color: var(--md-sys-color-surface);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.cuf-header-nav {
  background-color: #fff;
  height: 64px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  padding: 0 48px;
  box-sizing: border-box;
}

.cuf-header-title {
  font-family: 'Google Sans', 'Product Sans', Arial, sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface);
}

.cuf-container {
  max-width: 980px;
  margin: 0 auto 48px auto;
  padding: 40px;
  background-color: #fff;
  border-radius: 12px; /* M3 Medium Corner Radius */
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); /* Very subtle elevation */
}

.cuf-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 32px 0;
  gap: 12px;
}

.cuf-step {
  display: flex;
  align-items: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.cuf-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-size: 12px;
  transition: background-color 0.2s, color 0.2s;
}

.cuf-step-number i.material-icons {
  font-size: 16px;
}

.cuf-step-line {
  width: 32px;
  height: 1px;
  background-color: var(--md-sys-color-outline-variant);
  margin: 0 8px;
}

.cuf-step.active {
  color: var(--md-sys-color-on-surface);
  font-weight: 700;
}

.cuf-step.active .cuf-step-number {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.cuf-step.done {
  color: var(--md-sys-color-on-surface);
}

.cuf-step.done .cuf-step-number {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.cuf-row {
  display: flex;
  gap: 80px;
}

.cuf-main {
  width: 480px;
  flex: none;
}

.cuf-help {
  width: 290px;
  flex: none;
  margin-left: 90px;
  padding-left: 32px;
  border-left: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

.cuf-help-error-details {
  color: #b00020;
  margin-top: auto;
  margin-bottom: 160px;
  padding-top: 24px;
  font-weight: 400;
  line-height: 1.6;
}

.cuf-main-instruction {
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 24px;
}

.cuf-main-header {
  font-family: 'Google Sans', 'Product Sans', Arial, sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 16px;
}

.cuf-label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
  letter-spacing: 0.1px;
}

.cuf-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
  background-color: #fff;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cuf-input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  border-width: 1px;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

.cuf-button {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  height: 40px;
  width: 304px;
  padding: 0 24px;
  border: none;
  border-radius: 8px; /* M3 Small Corner Radius */
  font-family: 'Google Sans', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.cuf-button:hover {
  background-color: #1765cc;
  box-shadow: 0 1px 3px 1px rgba(0,0,0,0.15), 0 1px 2px 0 rgba(0,0,0,0.3);
}

.cuf-button:active {
  transform: scale(0.98);
}

.cuf-button.outline {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-primary);
}

.cuf-button.outline:hover {
  background-color: rgba(26, 115, 232, 0.04);
  box-shadow: none;
}

.cuf-button.fit-content {
  width: auto;
  min-width: 120px;
}

.cuf-button:disabled,
.cuf-button.loading {
  background-color: var(--md-sys-color-outline-variant);
  color: transparent !important;
  cursor: default;
  pointer-events: none;
  position: relative;
}

.cuf-loader {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--md-sys-color-primary);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: -11px 0 0 -11px;
  animation: rotate 0.8s linear infinite;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.cuf-success-icon {
  font-size: 64px;
  color: var(--md-sys-color-primary);
  margin-bottom: 24px;
}

.cuf-success-message {
  color: #137333;
  background-color: #e6f4ea;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #c6e7d1;
  font-size: 14px;
}

.cuf-error-banner {
  color: #b00020;
  background-color: #fce8e6;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #f5c2c7;
  font-size: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cuf-error-banner i.material-icons {
  font-size: 20px;
}

.cuf-footer {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  text-align: center;
}

.cuf-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}

.cuf-footer-links a {
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
}

.cuf-footer-links a:hover {
  color: var(--md-sys-color-on-surface);
  text-decoration: underline;
}

.cuf-language-selector select {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  padding: 4px 12px;
  background-color: #fff;
  cursor: pointer;
}

/* Helper Classes */
.cuf-note {
  margin: 16px 0 32px 0;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.6;
}

.cuf-divider {
  border: none;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin: 16px 0;
}

.cuf-form-group {
  margin-bottom: 24px;
}

/* Accordion Styles */
.cuf-category-accordion {
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.cuf-category-accordion[open] {
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cuf-category-accordion summary {
  padding: 10px 16px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  background-color: var(--md-sys-color-surface-container-low);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  outline: none;
}

.cuf-category-accordion summary::-webkit-details-marker {
  display: none;
}

.cuf-category-accordion summary::after {
  content: '\e313'; /* expand_more */
  font-family: 'Material Icons';
  font-size: 20px;
  color: var(--md-sys-color-on-surface-variant);
  transition: transform 0.2s;
}

.cuf-category-accordion[open] summary::after {
  transform: rotate(180deg);
}

.cuf-options-list {
  padding: 8px 0;
  background-color: #fff;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}

.cuf-radio-label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.cuf-radio-label:hover {
  background-color: var(--md-sys-color-surface-container);
}

.cuf-radio-label input[type="radio"] {
  margin-right: 12px;
  accent-color: var(--md-sys-color-primary);
}

.cuf-radio-text {
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
}

/* Updated Sidebar Styles */
.cuf-help-content {
  padding: 0;
}

.cuf-help-section {
  margin-bottom: 16px;
}

.cuf-help-section.cuf-details-alignment {
  margin-top: 156px;
}

.cuf-help-section + .cuf-help-section.cuf-details-alignment {
  margin-top: 96px; /* Reduced margin if follows another help section (e.g. user email) */
}

.cuf-help-section-header {
  font-weight: 700;
  font-size: 13px;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 4px;
}

.cuf-help-section-text {
  font-size: 13px;
  color: var(--md-sys-color-text-secondary);
  word-break: break-word;
}

/* Back Link Styles */
.cuf-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--md-sys-color-text-secondary);
  font-size: 13px;
  margin-bottom: 8px;
  transition: color 0.2s;
  cursor: pointer;
}

.cuf-back-link:hover {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

.cuf-back-link i.material-icons {
  font-size: 18px;
}

.cuf-actions {
  margin-top: 32px;
  display: flex;
  justify-content: flex-start;
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .cuf-container {
    padding: 24px;
    margin: 16px auto;
  }

  .cuf-stepper {
    margin: 24px 0;
    gap: 8px;
  }

  .cuf-step-label-extra {
    display: none;
  }

  .cuf-step-line {
    width: 20px;
    margin: 0 4px;
  }

  .cuf-row {
    flex-direction: column;
    gap: 32px;
  }

  .cuf-main,
  .cuf-help {
    width: 100%;
    flex: none;
    margin-left: 0;
  }

  .cuf-help {
    padding-left: 0;
    border-left: none;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    padding-top: 24px;
    flex: none;
  }

  .cuf-help-section.cuf-details-alignment {
    margin-top: 24px;
  }

  .cuf-help-error-details {
    margin-top: 24px;
    margin-bottom: 24px;
    padding-top: 0;
  }
}

/* DNS Record Styling */
.cuf-dns-box {
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  padding: 16px;
  margin: 24px 0;
}

.cuf-dns-row {
  display: flex;
  margin-bottom: 16px;
}

.cuf-dns-row:last-child {
  margin-bottom: 0;
}

.cuf-dns-label {
  width: 130px;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  color: var(--md-sys-color-text-secondary);
  text-transform: uppercase;
  padding-top: 4px; /* Align with value text */
}

.cuf-dns-value {
  flex: 1;
  font-family: 'Roboto Mono', 'Roboto', monospace;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
  overflow-wrap: break-word;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cuf-copy-button {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--md-sys-color-primary);
  display: inline-flex;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.cuf-copy-button:hover {
  background-color: var(--md-sys-color-surface-container);
}

.cuf-copy-button i.material-icons {
  font-size: 18px;
}

/* Summary Box Styling */
.cuf-summary-box {
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px;
  padding: 16px;
  margin: 24px 0;
}

.cuf-summary-row {
  display: flex;
  margin-bottom: 16px;
}

.cuf-summary-row:last-child {
  margin-bottom: 0;
}

.cuf-summary-label {
  width: 140px;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 11px;
  color: var(--md-sys-color-text-secondary);
  text-transform: uppercase;
  padding-top: 2px;
}

.cuf-summary-value {
  flex: 1;
  font-size: 14px;
  color: var(--md-sys-color-on-surface);
  overflow-wrap: break-word;
}

@media (max-width: 480px) {
  .cuf-step-label {
    display: none;
  }

  .cuf-stepper {
    gap: 4px;
  }
}

