@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #d8b4fe;
  --secondary: #64748b;
  --accent: #f43f5e;
  --background: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
  --radius: 16px;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
}

body {
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
}

header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  letter-spacing: -0.02em;
}

.logo-box {
  background: var(--primary);
  color: white !important;
  padding: 0.1rem 0.6rem;
  border-radius: 8px;
}

.logo-accent {
  color: #a855f7 !important;
  -webkit-text-fill-color: initial !important;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

main {
  max-width: 1800px;
  width: 95%;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
    gap: 0.5rem;
  }

  .header-actions span {
    width: 100%;
    margin-bottom: 0.25rem;
  }

  main {
    width: 100%;
    margin: 1rem auto;
    padding: 0 0.5rem;
    gap: 1.5rem;
  }

  section {
    padding: 1.25rem;
  }

  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .file-actions {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
  }

  .total-card {
    padding: 1.25rem;
  }

  .total-amount {
    font-size: 1.5rem;
  }

  .overlay-content {
    padding: 1.5rem;
    width: 95%;
  }

  .settings-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.85rem;
  }

  /* Form optimization */
  .destinataire-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 1.25rem !important;
    padding: 1.25rem;
  }

  .destinataire-row .field-group {
    flex: none !important;
    width: 100% !important;
    max-width: none !important;
  }

  .add-dest-btn,
  .remove-dest-btn {
    width: 100%;
  }

  .member-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .member-row>div:last-child {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
  }
}

@media (min-width: 1024px) {
  main {
    width: 90%;
    max-width: 1800px;
    grid-template-columns: 1fr 2fr;
  }

  .full-width {
    grid-column: 1 / -1;
  }
}

section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: #fff;
  font-size: 1rem;
  transition: all 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

button {
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

#zoneDepot {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  background-color: #fbfcfe;
  transition: all 0.3s ease;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#zoneDepot:hover,
#zoneDepot.drag-over {
  border-color: var(--primary);
  background-color: rgba(99, 102, 241, 0.05);
  transform: scale(1.01);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  list-style: none;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.file-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
  border-color: var(--primary);
}

.file-info {
  flex-grow: 1;
}

.file-name {
  font-weight: 600;
  display: block;
}

.file-meta {
  font-size: 0.875rem;
  color: var(--text-light);
}

.file-actions {
  display: flex;
  gap: 0.5rem;
}

.action-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
  background: #f1f5f9;
}

.action-icon:hover {
  background: var(--primary);
}

.action-icon:hover img {
  filter: brightness(0) invert(1);
}

/* Settings Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
}

.overlay-content {
  background: white;
  border-radius: var(--radius);
  padding: 3rem;
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeIn 0.4s ease forwards;
}

.success-message {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background-color: #dcfce7;
  color: #166534;
  text-align: center;
  border-bottom: 1px solid #bbf7d0;
  z-index: 9999;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.total-card {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.2);
  font-weight: 600;
}

.total-amount {
  font-size: 1.15rem;
  font-weight: 800;
}

/* Destinataires styling */
.destinataire-row {
  display: flex;
  gap: 1.25rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 1.25rem !important;
  align-items: flex-end !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.destinataire-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.destinataire-row .field-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.destinataire-row .field-group:first-child {
  flex: 2.5;
}

.destinataire-row .field-group:last-of-type {
  flex: 1.5;
}

.destinataire-row label {
  font-size: 0.85rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0 !important;
}

.destinataire-row input {
  background-color: #f8fafc !important;
  border: 2px solid transparent !important;
  border-radius: 12px !important;
  width: 100%;
  padding: 0.875rem 1.25rem !important;
  font-size: 1rem;
  color: #1e293b;
  font-weight: 600;
}

.destinataire-row input[type="number"] {
  font-size: 1rem;
  font-weight: 700;
  color: #6366f1;
  text-align: center;
  padding: 0.875rem 0.5rem !important;
  background-color: #f5f7ff !important;
}

.destinataire-row input[type="number"]:focus {
  border: 2px solid #6366f1 !important;
  background-color: #fff !important;
}

.add-dest-btn,
.remove-dest-btn {
  height: 48px;
  width: 48px;
  min-width: 48px;
  border-radius: 12px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--primary);
}

.add-dest-btn:hover {
  background: #eff6ff;
  border-color: var(--primary);
  transform: scale(1.05);
}

.remove-dest-btn:hover {
  background: #fef2f2 !important;
  border-color: #fee2e2 !important;
  color: #ef4444 !important;
  transform: scale(1.05);
}

.destinataire-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background-color: #fff;
}

.add-dest-btn,
.remove-dest-btn {
  min-width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.add-dest-btn {
  background-color: #f1f5f9;
  color: #6366f1;
}

.add-dest-btn:hover {
  background-color: #e2e8f0;
  transform: translateY(-1px);
}

.remove-dest-btn {
  background-color: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecaca;
}

.remove-dest-btn:hover {
  background-color: #ffe4e6;
  transform: translateY(-1px);
}

/* Auth Pages (Login/Signup) Styles */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-image: url('pay_to_doc_login_bg_1772980702535.png');
  background-size: cover;
  background-position: center;
  position: relative;
}

.auth-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
}

.auth-card {
  background: white;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 1050px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-info {
  background: var(--primary-gradient);
  color: white;
  padding: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-info h2 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.auth-info p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
}

.auth-form {
  padding: 4.5rem;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .auth-card {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .auth-info {
    display: none;
  }

  .auth-container {
    padding: 1rem;
  }

  .auth-form {
    padding: 3rem 2rem;
  }
}