.chip:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.8);
  outline-offset: 2px;
}
:root {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #ffffff;
  background-color: #000000;
}

* {
  box-sizing: border-box;
}

body, html, #root, .app-shell {
  height: 100%;
  margin: 0;
}

body {
  background-color: #0f172a;
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  max-width: 420px;
  margin: 0 auto;
  height: 100%;
  background: radial-gradient(circle at top, #1d4ed8, #0f172a);
  color: #fff;
}

.auth-header h1 {
  margin: 0;
  font-size: 2.2rem;
}

.auth-header p {
  margin: 0.25rem 0 1.5rem;
  color: rgba(255, 255, 255, 0.8);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field span {
  font-size: 0.85rem;
  font-weight: 500;
}

.field input,
.field select {
  padding: 0.75rem;
  border-radius: 999px;
  border: none;
  outline: none;
  font-size: 0.95rem;
}

.primary {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.secondary {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #38bdf8;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 600;
}

.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: inherit;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 1rem;
}

.cta-row .ghost {
  margin-top: 0;
}

.feedback {
  padding: 0.6rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
}

.feedback.error {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.feedback.info {
  background: rgba(59, 130, 246, 0.2);
  color: #bfdbfe;
}

.start-screen {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  color: #fff;
  background-size: cover;
  background-position: center;
}

.start-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 0;
}

.start-screen > * {
  position: relative;
  z-index: 1;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
}

.company-info h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.company-info span {
  font-size: 0.8rem;
  opacity: 0.8;
}

.actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
}

.hero {
  padding: 2.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.hero h1 {
  font-size: 2rem;
  margin: 0;
}

.hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.cta-row {
  display: flex;
  gap: 0.75rem;
}

.profile-drawer {
  background: #f1f5f9;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.profile-drawer header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
  color: #fff;
}

.profile-body {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.profile-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-form .field input {
  border: 1px solid #94a3b8;
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: #fff;
}

button {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.97);
}

.notifications-screen,
.progress-screen,
.tips-screen,
.library-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #0f172a;
  color: #fff;
}

.notifications-body,
.progress-body,
.tips-body,
.library-body {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-header h3 {
  margin: 0;
}

.notification-list,
.progress-list,
.tips-list,
.library-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notification-card {
  background: rgba(15, 23, 42, 0.75);
  border-radius: 1rem;
  padding: 1rem;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid transparent;
}

.progress-card {
  background: rgba(248, 250, 252, 0.95);
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.progress-card.loading {
  text-align: center;
  color: #475569;
}

.progress-title {
  font-weight: 600;
  font-size: 1rem;
}

.progress-meta {
  font-size: 0.85rem;
  color: #475569;
  display: flex;
  gap: 0.5rem;
}

.progress-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-body .feedback.info {
  background: rgba(15, 23, 42, 0.1);
  color: #0f172a;
}

.tip-card {
  background: rgba(248, 250, 252, 0.95);
  border-radius: 1rem;
  padding: 1rem;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.tip-card.loading {
  text-align: center;
  color: #475569;
}

.tip-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.tip-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.secondary-badge {
  background: rgba(37, 99, 235, 0.2);
  color: #1d4ed8;
}

.tip-meta {
  font-size: 0.8rem;
  color: #475569;
}

.category-chips {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  min-height: 48px;
  align-items: center;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}

.chip.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
}

.library-card {
  background: rgba(248, 250, 252, 0.95);
  border-radius: 1rem;
  padding: 1rem;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

.library-card.loading {
  text-align: center;
  color: #475569;
}

.library-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.library-card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.library-card-actions .secondary {
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.15);
  color: #0f172a;
}

.library-card-actions .secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.library-card-header h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.library-card-header p {
  margin: 0.35rem 0 0;
}

.library-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.library-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #475569;
}

.library-card-details {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.details-json {
  margin: 0;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-family: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  overflow-x: auto;
}

.muted-badge {
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
}

.progress-section .list-header h3 {
  margin: 0;
}

.notification-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.notification-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.notification-card.loading,
.notification-card.empty {
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: default;
}

.notification-title {
  font-weight: 600;
  font-size: 1rem;
}

.notification-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.8;
  align-items: center;
}

.notification-photo {
  margin-top: 0.5rem;
  border-radius: 0.75rem;
  overflow: hidden;
  max-height: 220px;
}

.notification-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-group ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  color: inherit;
}

.attachment-group a {
  color: #2563eb;
  text-decoration: none;
}

.attachment-group a:hover {
  text-decoration: underline;
}

.forms-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #0f172a;
  color: #fff;
}

.forms-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
}

.forms-panel {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-loader,
.forms-directory,
.form-submission-result,
.forms-history,
.form-response-card,
.form-runner {
  background: rgba(248, 250, 252, 0.95);
  color: #0f172a;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-loader p,
.form-submission-result p {
  margin: 0;
  color: #475569;
}

.loader-row {
  display: flex;
  gap: 0.75rem;
}

.loader-row input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5f5;
  font-size: 0.95rem;
}

.forms-directory-search {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.forms-directory-search input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5f5;
  font-size: 0.95rem;
}

.forms-directory-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-directory-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.08);
  gap: 1rem;
}

.form-directory-card.loading {
  justify-content: center;
  color: #475569;
}

.form-directory-card h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.form-directory-meta {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
  flex-wrap: wrap;
}

.forms-history-list,
.form-response-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-history-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid transparent;
  gap: 1rem;
}

.form-history-card.loading {
  justify-content: center;
  color: #475569;
}

.form-history-card.active {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
}

.form-history-card h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.form-history-card span {
  font-size: 0.85rem;
  color: #64748b;
}

.form-response-card {
  gap: 1.25rem;
}

.form-response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-response-header h3 {
  margin: 0;
}

.form-response-header span {
  font-size: 0.85rem;
  color: #64748b;
}

.form-response-section h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.form-response-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.05);
}

.form-response-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-response-value {
  font-size: 0.9rem;
  color: #475569;
  word-break: break-word;
}

.form-response-link {
  font-size: 0.9rem;
  color: #2563eb;
}

.form-runner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.form-runner-header h2 {
  margin: 0;
}

.form-runner-actions {
  display: flex;
  gap: 0.5rem;
}

.form-runner-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.form-question {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid transparent;
}

.form-question.has-error {
  border-color: rgba(239, 68, 68, 0.4);
}

.form-question-header h4 {
  margin: 0;
  font-size: 1rem;
}

.question-subtitle {
  margin: 0.25rem 0 0;
  color: #475569;
  font-size: 0.9rem;
}

.form-question-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

.required-indicator {
  margin-left: 0.35rem;
  color: #ef4444;
}

.form-question-images {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-question-images img {
  max-height: 140px;
  border-radius: 0.6rem;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.form-question-control input[type="text"],
.form-question-control textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5f5;
  font-size: 0.95rem;
}

.form-question-control textarea {
  resize: vertical;
  min-height: 120px;
}

.form-question-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.form-question-error {
  font-size: 0.85rem;
  color: #ef4444;
}

.form-question-slider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-question-slider input[type="range"] {
  flex: 1;
}

.slider-value {
  font-size: 0.9rem;
  color: #475569;
  min-width: 60px;
}

.form-question-upload {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-name {
  font-size: 0.85rem;
  color: #475569;
}

.signature-pad {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  border-radius: 0.75rem;
  border: 2px dashed rgba(15, 23, 42, 0.2);
  background: #fff;
  touch-action: none;
}

@media (min-width: 768px) {
  .auth-card {
    border-radius: 24px;
    margin-top: 4rem;
    height: auto;
  }

  .start-screen {
    border-radius: 24px;
    overflow: hidden;
    margin: 1.5rem;
  }

  .profile-drawer {
    border-radius: 24px;
    margin: 1.5rem auto;
    max-width: 480px;
  }

  .notifications-screen,
  .progress-screen,
  .tips-screen,
  .library-screen,
  .forms-screen {
    border-radius: 24px;
    margin: 1.5rem;
    overflow: hidden;
  }

  .notifications-screen .top-bar,
  .progress-screen .top-bar,
  .tips-screen .top-bar,
  .library-screen .top-bar,
  .forms-screen .top-bar {
    padding: 1rem 1.5rem;
  }

  .notifications-body,
  .progress-body,
  .tips-body,
  .library-body,
  .forms-body {
    max-height: 50vh;
  }
}
