/* Base Canvas Setup - Talkmobile Standard Aesthetic */
body {
  background-color: #fcfbfe;
  font-family: "Comme", "PT Sans", sans-serif;
  color: #222222;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  box-sizing: border-box;
}

/* Top Brand Navigation Bar */
header {
  position: sticky;
  top: 0;
  background-color: #ffffff;
  color: #51256d; /* Talkmobile Deep Plum */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 40px;
  border-bottom: 1px solid #f1eef5;
  box-shadow: 0 2px 10px rgba(81, 37, 109, 0.03);
  flex-shrink: 0;
  z-index: 1000;
}

.logo-area {
  font-weight: 700;
  font-size: 16pt;
  letter-spacing: -0.8px;
  color: #51256d;
}

.home-btn {
  text-decoration: none;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 12pt;
  color: #6c6575;
}

#welcome-msg {
  font-weight: 600;
}

/* Authentication Buttons Styling */
#login-btn {
  display: none;
}

.auth-btn {
  background: none;
  border: none;
  font-family: "Comme", sans-serif;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: 12pt;
}

.btn-login {
  color: #51256d;
}

.btn-login:hover {
  color: #d67400;
}

.btn-logout {
  color: #dc3545;
}

/* Centered Flat Component Card Canvas */
.workspace-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  padding: 24px;
}

.form-card {
  background: #ffffff;
  border: 1px solid #ebe6f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  padding: 35px;
  width: 85vw;
  max-width: 1200px;
  box-sizing: border-box;
  box-shadow: 0 4px 24px rgba(81, 37, 109, 0.04);
}

.form-scroll-box {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 12px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #fdfcff;
}
::-webkit-scrollbar-thumb {
  background: #cbd2d9;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #51256d;
}

/* Form Row Layout Structure */
.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 20px;
}

/* DPA Input Row */
#DPA-status {
  width: fit-content;
}

.input-row-DPA {
  grid-template-columns: auto 1fr;
}

.input-row .input-group {
  margin-bottom: 0;
}

label {
  font-size: 13pt;
  font-weight: 600;
  color: #51256d;
  margin-bottom: 6px;
}

/* Form Controls */
input[type="text"],
select,
textarea {
  background: #ffffff;
  border: 1px solid #cbd2d9;
  border-radius: 6px;
  padding: 12px;
  color: #222222;
  font-family: "Comme", sans-serif;
  font-size: 13pt;
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  width: 100%;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #51256d;
  box-shadow: 0 0 0 3px rgba(81, 37, 109, 0.1);
}

textarea {
  resize: vertical;
  height: 150px;
}

/* Template Insertion Button Styling */
.insert-template-btn {
  display: block;
  width: 100%;
  background: #f7f4fa;
  border: 1px solid #ebe6f0;
  color: #51256d;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Comme", sans-serif;
  font-size: 13pt;
  font-weight: 600;
  transition:
    background 0.2s,
    border-color 0.2s;
  margin-bottom: 20px;
  text-align: center;
}

.insert-template-btn:hover {
  background: #efeaf5;
  border-color: #51256d;
}

/* Operational Element Visibility Controls */
#call-transfer {
  display: none;
}

#welcome-msg,
#post-btn,
#logout-btn {
  display: none;
}

/* Footer Action Controls Row */
.footer-controls {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding-top: 20px;
  border-top: 1px solid #f1eef5;
  flex-shrink: 0;
}

button.action-btn {
  font-family: "Comme", sans-serif;
  font-size: 11pt;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 20px; /* Pill style */
  border: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    transform 0.1s;
}

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

.btn-clear {
  background: #ffffff;
  border: 2px solid #51256d;
  color: #51256d;
}

.btn-clear:hover {
  background: #f7f4fa;
}

.btn-generate {
  background: #51256d;
  color: #ffffff;
}

.btn-generate:hover {
  background: #401d56;
}

/* --- INTERACTIVE MODAL DIALOG DISPLAY ENGINE --- */
.modal-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(81, 37, 109, 0.4); /* Soft brand-tinted overlay */
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 2000;
}

.modal-background.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-surface {
  background: #ffffff;
  border-radius: 12px;
  width: 70%;
  max-width: 80vh;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 28px;
  box-shadow: 0 12px 40px rgba(81, 37, 109, 0.12);
  transform: translateY(15px);
  transition: transform 0.2s ease;
}

.modal-background.visible .modal-surface {
  transform: translateY(0);
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 2px solid #f7f4fa;
  padding-bottom: 12px;
}

.modal-headline {
  font-size: 13pt;
  font-weight: 700;
  color: #51256d;
}

.modal-dismiss-x {
  background: none;
  border: none;
  color: #a39bb0;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-dismiss-x:hover {
  color: #51256d;
}

/* Formatted note container matching the requested 14pt typography specification */
.modal-text-frame {
  background: #fcfbfe;
  border: 1px solid #ebe6f0;
  border-radius: 8px;
  padding: 18px;
  max-height: 650px;
  overflow-y: auto;
  font-size: 14pt;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #222222;
  font-family: "Comme", sans-serif;
}

.modal-button-container {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-clipboard {
  background: #ffffff;
  color: #51256d;
  border: 2px solid #51256d;
}

.btn-clipboard:hover {
  background: #f7f4fa;
}

.btn-dispatch {
  background: #d67400; /* Ochre yellow primary accent action signature */
  color: #ffffff;
}

.btn-dispatch:hover {
  background: #b86300;
}

.btn-close-modal {
  background: #6c757d;
  color: #ffffff;
}

.btn-close-modal:hover {
  background: #5a6268;
}

/* Success Feedback Notification Popup */
.toast-popup {
  position: fixed;
  top: 24px;
  right: 30px;
  background: #51256d;
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 10.5pt;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(81, 37, 109, 0.15);
  transform: translateX(80px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 3000;
  pointer-events: none;
}

.toast-popup.show-alert {
  transform: translateX(0);
  opacity: 1;
}

.alert-danger {
  background: #dc3545 !important;
}

.alert-success {
  /* background: #28a745 !important; */
  background: #51256d;
  color: #ffffff;
}

button:disabled {
  background-color: #f1eef5 !important;
  border-color: #f1eef5 !important;
  color: #a39bb0 !important;
  cursor: not-allowed !important;
}

input:disabled {
  background-color: #f1eef5 !important;
  border-color: #f1eef5 !important;
  color: #a39bb0 !important;
  cursor: not-allowed !important;
}

select:disabled {
  background-color: #f1eef5 !important;
  border-color: #f1eef5 !important;
  color: #a39bb0 !important;
  cursor: not-allowed !important;
}
