/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");

body {
  font-family: "Google Sans", "Product Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fdfdff;
  min-height: 100vh;
}

body:not(.landing-body) {
  padding-top: 3.5rem;
}

.app-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem 3rem 0.75rem 18px;
  background: #f3f4f9;
  color: #1f2933;
  font-size: 0.95rem;
  border-bottom: 1px solid #e2e6f0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

.menu-text {
  color: #111827;
}

.menu-link {
  color: #5a43f2;
  font-weight: 600;
  text-decoration: none;
}

.menu-link:hover {
  text-decoration: underline;
}

.menu-divider {
  width: 1px;
  height: 20px;
  background: #c5c8d4;
  display: inline-block;
}

.menu-select {
  margin: 0;
}

.menu-select select {
  border-radius: 999px;
  border: 1px solid #cbd2df;
  padding: 0.2rem 0.85rem;
  background: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
}

.page-wrapper {
  max-width: 480px;
  margin: 4rem auto;
  padding: 2.5rem 3rem;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(17, 32, 81, 0.12);
}

.oauth-card {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.oauth-form {
  margin: 0;
}

.oauth-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  border: 1px solid #dadce0;
  border-radius: 999px;
  background: #ffffff;
  color: #1f1f1f;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.oauth-button::before {
  content: "";
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg fill='none' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.6 10.227C19.6 9.54966 19.5405 8.89966 19.4314 8.2771H10V12.0771H15.4314C15.1977 13.3271 14.5 14.3771 13.4499 15.0771V17.5771H16.6499C18.5773 15.8271 19.6 13.2771 19.6 10.2271Z' fill='%234285F4'/%3E%3Cpath d='M10 20.0001C12.7 20.0001 14.97 19.1001 16.6499 17.5776L13.4499 15.0776C12.5499 15.6776 11.4 16.0276 10 16.0276C7.39998 16.0276 5.19998 14.2626 4.39998 11.9176H1.09998V14.4976C2.76998 17.7976 6.09998 20.0001 10 20.0001Z' fill='%2334A853'/%3E%3Cpath d='M4.40002 11.9174C4.20002 11.3174 4.10002 10.6774 4.10002 9.99993C4.10002 9.32247 4.20002 8.68247 4.40002 8.08247V5.50247H1.10002C0.400024 6.90247 0 8.40247 0 9.99993C0 11.5974 0.400024 13.0974 1.10002 14.4974L4.40002 11.9174Z' fill='%23FBBC05'/%3E%3Cpath d='M10 3.9725C11.55 3.9725 12.93 4.505 14.03 5.5575L16.73 2.8575C14.97 1.2075 12.7 0 10 0C6.09998 0 2.76998 2.2025 1.09998 5.5025L4.39998 8.0825C5.19998 5.7375 7.39998 3.9725 10 3.9725Z' fill='%23EA4335'/%3E%3C/svg%3E");
  background-size: contain;
}

.oauth-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.form-divider {
  position: relative;
  text-align: center;
  margin: 1.5rem 0;
  font-weight: 600;
  color: #9aa1b4;
}

.form-divider::before,
.form-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #e5e7f2;
}

.form-divider::before {
  left: 0;
}

.form-divider::after {
  right: 0;
}

.form-divider span {
  background: #ffffff;
  padding: 0 0.5rem;
}

.page-wrapper h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.page-subtitle {
  color: #5b6474;
  margin-bottom: 1.5rem;
}

.stacked-form {
  display: grid;
  gap: 1.25rem;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #1f2933;
}

.brand-mark {
  margin-right: auto;
  margin-left: 0;
  font-family: "Montserrat", "Roboto", "Google Sans", "Product Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 2rem;
  letter-spacing: 0;
  color: #5a43f2;
  display: inline-flex;
  align-items: center;
}

.brand-mark__super {
  color: #000000;
  margin-left: -6px;
  font-weight: 500;
}

.brand-mark__texter {
  color: #000000;
  font-weight: 700;
}

.brand-mark__logo {
  height: 46px;
  width: auto;
  margin-right: 0.45rem;
  display: block;
  transform: translateY(-6px);
}

.form-field input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd2df;
  border-radius: 12px;
  font-size: 1rem;
  color: #111827;
  background: #ffffff;
}

.field-support {
  color: #7c8598;
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}

.primary-button {
  display: inline-flex;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #5a43f2, #9477ff);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(90, 67, 242, 0.35);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 46px rgba(90, 67, 242, 0.4);
}

.form-errors {
  border-left: 4px solid #ec5d57;
  background: #fff2f1;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.form-errors h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.25rem;
}

.page-link {
  margin-top: 2.5rem;
  text-align: center;
}

.page-link a {
  color: #5a43f2;
  font-weight: 600;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7f2;
  text-align: left;
}

.data-table th {
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7c8598;
}

.definition-list {
  display: grid;
  grid-template-columns: 170px 1fr;
  row-gap: 0.75rem;
  column-gap: 1rem;
  margin: 1.5rem 0;
}

.definition-list dt {
  font-weight: 600;
  color: #5b6474;
}

.definition-list dd {
  margin: 0;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: 0.03em;
}

.inline-list {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 0;
  color: #1f2933;
}

.inline-list li {
  margin-bottom: 0.25rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: capitalize;
  background: #e5e7eb;
  color: #111827;
}

.status-pill.pass {
  background: #dcfce7;
  color: #166534;
}

.status-pill.warn,
.status-pill.warning {
  background: #fef9c3;
  color: #854d0e;
}

.status-pill.fail,
.status-pill.error {
  background: #fee2e2;
  color: #991b1b;
}

.inline-form {
  display: inline;
}

.flash-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
}

.flash-banner {
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.25);
}

.flash-banner.alert {
  background: rgba(239, 68, 68, 0.95);
}

.conversation-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  padding: 10px;
}

.conversation-list {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 15px 35px rgba(30, 41, 59, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

.conversation-list__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #eef1f8;
}

.eyebrow-label {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #9aa1b4;
  margin: 0;
}

.conversation-list__company {
  margin: 0.15rem 0 0;
  font-weight: 600;
  color: #111827;
}

.ghost-button {
  border: 1px solid #d9def0;
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-weight: 600;
  color: #5a43f2;
  text-decoration: none;
  background: #ffffff;
}

.conversation-list__body {
  flex: 1;
  overflow-y: auto;
}

.conversation-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.conversation-list-item {
  border-bottom: 1px solid #f1f3fb;
}

.conversation-list-item:last-child {
  border-bottom: none;
}

.conversation-list-item__link {
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: inherit;
}

.conversation-list-item.is-active {
  background: rgba(90, 67, 242, 0.06);
}

.conversation-list-item__parties {
  display: flex;
  gap: 0.35rem;
  font-weight: 600;
  color: #1f2933;
}

.conversation-list-item__preview {
  margin: 0.3rem 0;
  color: #4b5563;
  font-size: 0.9rem;
}

.conversation-list-item__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #9aa1b4;
  margin: 0;
}

.conversation-list-item__badge {
  background: rgba(90, 67, 242, 0.15);
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-weight: 600;
  color: #5a43f2;
}

.conversation-panel {
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

.conversation-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 2rem 0 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.conversation-panel__title {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.conversation-panel__timestamp {
  font-size: 0.85rem;
  color: #6b7280;
}

.conversation-thread {
  flex: 1;
  padding: 1.25rem 2rem;
  overflow-y: auto;
  display: grid;
  gap: 1rem;
}

.message-bubble {
  border-radius: 18px;
  padding: 1rem 1.25rem;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

.message-bubble.outgoing {
  justify-self: start;
  background: #eef2ff;
}

.message-bubble.incoming {
  justify-self: end;
  background: #ffffff;
}

.message-bubble.ai-response {
  border: 1px solid rgba(90, 67, 242, 0.25);
}

.message-bubble__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7c8598;
  margin-bottom: 0.35rem;
}

.message-bubble__meta {
  font-size: 0.75rem;
  color: #9aa1b4;
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.message-bubble.author-contact {
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.message-bubble.author-ai {
  border: 1px solid rgba(90, 67, 242, 0.3);
}

.message-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}

.message-badge--pending {
  background: rgba(251, 191, 36, 0.2);
  color: #b45309;
}

.message-badge--rejected {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.message-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.message-action {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.message-action--approve {
  background: #10b981;
  color: #fff;
}

.message-action--reject {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

.ai-placeholder {
  border-radius: 16px;
  padding: 1.25rem;
  background: #f9fafb;
  color: #4b5563;
}

.conversation-composer {
  padding: 1.25rem 2rem 2rem;
  border-top: 1px solid #f2f4fd;
}

.conversation-form {
  display: grid;
  gap: 1rem;
}

.conversation-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.conversation-form__field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: #1f2933;
}

.conversation-form__field input,
.conversation-form__field textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 0.65rem;
  font-size: 0.95rem;
}

.conversation-form__actions {
  display: flex;
  justify-content: flex-end;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: #6b7280;
}

.conversation-starter {
  margin-top: 1.25rem;
  padding: 1.5rem 2rem;
  border-radius: 18px;
  border: 1px dashed #d9def0;
  background: #fdfbff;
}

.composer-hint {
  margin: 0.25rem 0 1rem;
  color: #6b7280;
  font-size: 0.9rem;
}

.composer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.composer-panel {
  border: 1px solid #e3e7f5;
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.composer-panel h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: #1f2933;
}

.composer-panel--incoming {
  border-color: rgba(16, 185, 129, 0.4);
}

.composer-panel--outgoing {
  border-color: rgba(90, 67, 242, 0.4);
}

.composer-panel textarea {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  box-sizing: border-box;
}

.conversation-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  padding: 0.5rem;
  background: #fff;
}

.handler-toggle {
  text-align: right;
}

.handler-toggle__label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa1b4;
}

.handler-toggle__select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.75rem;
  background: #fff;
  font-weight: 600;
}

.instructions-card {
  margin: 1.25rem 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: 18px;
  background: #f6f5ff;
  border: 1px solid rgba(90, 67, 242, 0.15);
}

.instructions-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.instructions-card__header h2 {
  margin: 0.15rem 0 0;
  font-size: 1.1rem;
  color: #1f2933;
}

.instructions-card__tag {
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #c3c7ff;
  font-size: 0.75rem;
  color: #4c51bf;
}

.instructions-card__body {
  margin: 0.75rem 0 1rem;
  color: #4b5563;
}

.instructions-save-indicator {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: #10b981;
  font-weight: 600;
}

.instructions-card--saved {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  transition: box-shadow 200ms ease;
}

.instructions-form textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #cbd2df;
  padding: 0.75rem;
  font-size: 0.95rem;
  background: #fff;
  resize: vertical;
}

.instructions-form__actions {
  margin-top: 0.75rem;
  text-align: right;
}

.ghost-button--solid {
  background: #5a43f2;
  color: #fff;
  border-color: #5a43f2;
}

.conversation-form--message textarea {
  min-height: 120px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.message-bubble.incoming {
  justify-self: start;
  background: #ffffff;
}

.message-bubble.outgoing {
  justify-self: end;
  background: #eef2ff;
}

.message-bubble.author-contact {
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.message-bubble.author-ai {
  border: 1px solid rgba(90, 67, 242, 0.3);
}

@media (max-width: 1024px) {
  .conversation-layout {
    grid-template-columns: 1fr;
    padding: 4rem 1.5rem;
  }

  .conversation-panel,
  .conversation-list {
    min-height: auto;
  }
}
