.contact-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* Floating button */
.contact-widget__button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background-color: #2c4a64;
  color: white;
  border: none;
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  opacity: 0;
  animation: fadeIn 0.3s ease forwards 0.5s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.contact-widget__button:hover {
  background-color: #1f3449;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

.contact-widget__button:focus {
  outline: 2px solid #2491ff;
  outline-offset: 2px;
}

.contact-widget__button svg {
  width: 24px;
  height: 24px;
}

/* Hide button when panel is open */
.contact-widget__button[aria-expanded="true"] {
  display: none;
}

/* Slide-in panel */
.contact-widget__panel {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 550px;
  max-height: 85vh;
  background-color: white;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.3);
  border-radius: 12px 12px 0 0;
  display: none;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.contact-widget__panel[aria-hidden="false"] {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

/* Panel header */
.contact-widget__panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background-color: #2c4a64;
  color: white;
  border-radius: 12px 12px 0 0;
  gap: 12px;
}

.contact-widget__back {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.contact-widget__back:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.contact-widget__back:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

.contact-widget__panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.contact-widget__close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.contact-widget__close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.contact-widget__close:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Panel content */
.contact-widget__panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background-color: #f8f9fa;
}

/* Screen container */
.contact-widget__screen {
  padding: 20px;
  min-height: 100%;
}

/* Menu */
.contact-widget__subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #1b1b1b;
  margin: 0 0 16px 0;
}

.contact-widget__menu {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-widget__menu-item {
  background: white;
  border: none;
  border-bottom: 1px solid #e5e5e5;
  padding: 16px;
  text-align: left;
  font-size: 15px;
  font-weight: 400;
  color: #1b1b1b;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-widget__menu-item strong {
  font-size: 15px;
  font-weight: 600;
  color: #1b1b1b;
}

.contact-widget__menu-description {
  font-size: 13px;
  font-weight: 400;
  color: #5b616b;
  line-height: 1.4;
}

.contact-widget__menu-item:first-child {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.contact-widget__menu-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.contact-widget__menu-item:hover {
  background-color: #f0f0f0;
}

.contact-widget__menu-item:focus {
  outline: 2px solid #2491ff;
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

/* Form */
.contact-widget__form-title {
  font-size: 16px;
  font-weight: 600;
  color: #1b1b1b;
  margin: 0 0 16px 0;
}

.contact-widget__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1b1b1b;
  margin-bottom: 6px;
  margin-top: 16px;
}

.contact-widget__label:first-of-type {
  margin-top: 0;
}

.contact-widget__input,
.contact-widget__textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c4c4c4;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background-color: white;
  transition: border-color 0.2s ease;
}

.contact-widget__input:focus,
.contact-widget__textarea:focus {
  outline: none;
  border-color: #2491ff;
  box-shadow: 0 0 0 2px rgba(36, 145, 255, 0.2);
}

.contact-widget__textarea {
  resize: vertical;
  min-height: 100px;
}

.contact-widget__help-text {
  font-size: 12px;
  color: #68737d;
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.contact-widget__file-upload {
  position: relative;
  margin-top: 8px;
}

.contact-widget__file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.contact-widget__file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px dashed #c4c4c4;
  border-radius: 4px;
  background-color: #f8f9fa;
  color: #68737d;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.contact-widget__file-label:hover {
  border-color: #2491ff;
  background-color: #f0f4f8;
  color: #2491ff;
}

.contact-widget__file-label svg {
  width: 24px;
  height: 24px;
}

.contact-widget__file-list {
  margin-top: 12px;
}

.contact-widget__file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: #f0f0f0;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
}

.contact-widget__file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 12px;
}

.contact-widget__file-remove {
  background: none;
  border: none;
  color: #b50909;
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.contact-widget__file-remove:hover {
  color: #8b0707;
}

.contact-widget__submit {
  background-color: #2c4a64;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  float: right;
  transition: background-color 0.2s ease;
}

.contact-widget__submit:hover {
  background-color: #1f3449;
}

.contact-widget__submit:focus {
  outline: 2px solid #2491ff;
  outline-offset: 2px;
}

/* Alerts */
.contact-widget__panel-content .usa-alert {
  margin: 0 0 20px 0;
  border-radius: 0;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .contact-widget {
    bottom: 10px;
    right: 10px;
  }

  .contact-widget__button {
    padding: 10px 16px;
    font-size: 14px;
  }

  .contact-widget__button-text {
    display: none;
  }

  .contact-widget__panel {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .contact-widget__panel-header {
    border-radius: 0;
  }
}

/* Toast notification */
.contact-widget-toast {
  position: fixed;
  bottom: 90px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  font-size: 15px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  max-width: 420px;
  line-height: 1.4;
}

.contact-widget-toast--success {
  background-color: #00a91c;
}

.contact-widget-toast--error {
  background-color: #d54309;
}

.contact-widget-toast--show {
  opacity: 1;
  transform: translateY(0);
}

.contact-widget-toast--hide {
  opacity: 0;
  transform: translateY(20px);
}

.contact-widget-toast svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.contact-widget-toast span {
  flex: 1;
}

@media (max-width: 640px) {
  .contact-widget-toast {
    left: 20px;
    right: 20px;
    bottom: 80px;
    max-width: none;
  }
}
