:root {
  --primary-color: #1e3a8a; /* Professional Navy Blue */
  --primary-hover: #172554; /* Darker Navy Blue */
  --secondary-color: #64748b; /* Slate Gray */
  --secondary-hover: #475569;
  --success-color: #0d9488; /* Teal Accent */
  --success-hover: #0f766e;
  --error-color: #be123c; /* Sober Dark Red */
  --bg-color: #f8fafc; /* Clean Light Slate */
  --card-bg: #ffffff;
  --border-color: #cbd5e1; /* Crisp Slate Border */
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #475569; /* Slate 600 */
  --font-family: 'Inter', sans-serif;
  --transition-smooth: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 3rem 1rem;
}

/* Background Gradients */
.background-decorations {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.08;
}

.circle-1 {
  width: 450px;
  height: 450px;
  background: var(--primary-color);
  top: -100px;
  right: -50px;
}

.circle-2 {
  width: 450px;
  height: 450px;
  background: #3b82f6; /* Blue */
  bottom: -150px;
  left: -50px;
}

/* Main Container */
.container {
  width: 100%;
  max-width: 820px;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Onboarding Card */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

.form-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.logo-container {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary-color), #3b82f6);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.logo-icon {
  width: 26px;
  height: 26px;
  color: white;
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #0f172a;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Wizard Steps Progress */
.progress-container {
  position: relative;
  margin: 2.2rem auto 1.5rem;
  max-width: 600px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(to right, var(--primary-color), #3b82f6);
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.steps-indicator {
  display: flex;
  justify-content: space-between;
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 2;
}

.step-dot {
  width: 28px;
  height: 28px;
  background-color: #fff;
  border: 2px solid #cbd5e1;
  color: #64748b;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition-smooth);
  position: relative;
  cursor: default;
}

.step-dot.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.3);
}

.step-dot.completed {
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.dot-label {
  position: absolute;
  top: 36px;
  font-size: 0.725rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
  transform: translateX(-5px);
}

.step-dot.active .dot-label,
.step-dot.completed .dot-label {
  color: var(--text-main);
  font-weight: 600;
}

/* Step Layout Switch */
.form-step {
  display: none;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.form-step.active {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: #0f172a;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

/* Two Column Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.span-2 {
  grid-column: span 2;
}

/* Inputs, Selects & Textareas */
label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background-color: #ffffff;
}

/* Radio groups and checkboxes */
.radio-group,
.checkbox-group {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #334155;
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
}

/* Conditional sub-sections */
.sub-section {
  background-color: #f8fafc;
  border-left: 3px solid var(--primary-color);
  border: 1px solid #e2e8f0;
  border-left-width: 3px;
  border-left-color: var(--primary-color);
  border-radius: 0 10px 10px 0;
  padding: 1.25rem;
  margin-bottom: 0.5rem;
}

/* File Upload Field */
.file-upload-wrapper {
  position: relative;
  width: 100%;
  height: 48px;
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-dummy {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-size: 0.9rem;
  color: #64748b;
  transition: var(--transition-smooth);
}

.file-upload-wrapper:hover .file-dummy {
  border-color: var(--primary-color);
  background-color: #f1f5f9;
}

/* Alerts and Warnings */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

/* Section dividers */
.section-subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
  margin-top: 1rem;
  border-left: 3px solid var(--primary-color);
  padding-left: 0.5rem;
}

.section-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.section-block {
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  padding: 1.5rem;
  border-radius: 14px;
}

/* Bank Account Card Grid */
.bank-account-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
}

.bank-account-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.4rem;
}

.bank-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* Supplier Card Grid */
.supplier-card {
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  border-radius: 10px;
  padding: 1.25rem;
}

/* Tables styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

.dynamic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

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

.dynamic-table th {
  color: #334155;
  font-weight: 500;
}

.dynamic-table input {
  padding: 0.5rem;
  font-size: 0.85rem;
}

/* General Buttons */
.btn {
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-submit {
  background: linear-gradient(135deg, var(--primary-color), #3b82f6);
  color: white;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-danger-icon {
  background: transparent;
  color: var(--error-color);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.btn-danger-icon:hover {
  background-color: rgba(220, 38, 38, 0.08);
}

/* Validation Messages */
.input-error {
  border-color: var(--error-color) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.error-msg {
  display: block;
  font-size: 0.75rem;
  color: var(--error-color);
  margin-top: 0.25rem;
  min-height: 14px;
  opacity: 0;
  transform: translateY(-4px);
  transition: var(--transition-smooth);
}

.error-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Wizard control footer */
.form-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.form-footer button:only-child {
  margin-left: auto;
}

/* Loading Spinners */
.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  animation: rotate 2s linear infinite;
  width: 20px;
  height: 20px;
}

.spinner .path {
  stroke: #ffffff;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

@keyframes dash {
  0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
  100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.hidden {
  display: none !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary-color);
  color: var(--text-main);
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-size: 0.85rem;
  min-width: 320px;
  max-width: 450px;
  animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success { border-left-color: var(--success-color); }
.toast-error { border-left-color: var(--error-color); }

.toast-close {
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
}

.toast-close:hover { color: #0f172a; }

@keyframes slideInToast {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
  animation: fadeOutToast 0.25s forwards;
}

@keyframes fadeOutToast {
  to { opacity: 0; transform: translateY(8px); }
}

/* Responsive breakdowns */
@media (max-width: 768px) {
  body {
    padding: 1.5rem 0.5rem;
  }

  .form-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .span-2 {
    grid-column: span 1;
  }

  .dot-label {
    display: none;
  }

  .progress-container {
    margin: 1.5rem auto 1rem;
  }
}

/* Password Visibility Toggle */
.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  padding-right: 2.75rem !important;
}

.toggle-password-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.toggle-password-btn:hover {
  color: var(--primary-color);
  background-color: #f1f5f9;
}

/* Shared Modal System */
.detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
  position: relative;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}
