:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --success: #10B981;
  --success-hover: #059669;
  --bg-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
  --text-dark: #1F2937;
  --text-muted: #6B7280;
  --card-bg: #FFFFFF;
  --border-color: #E5E7EB;
  --radius: 16px;
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: #4f46e5;
  background: var(--bg-gradient);
  color: #1F2937;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 10;
  margin: auto;
}

.card {
  background: #FFFFFF;
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  color: #4F46E5;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: inline-block;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.card-header p {
  font-size: 14px;
  color: #4B5563;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #374151;
}

.required {
  color: #EF4444;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #FFFFFF;
  color: #111827;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #F3F4F6;
  color: #374151;
}
.btn-secondary:hover {
  background: #E5E7EB;
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: var(--success-hover);
}

/* Modal Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
}

.modal-card {
  background: #FFFFFF;
  border-radius: var(--radius);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: popIn 0.25s ease-out;
  color: #111827;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-icon {
  font-size: 36px;
  text-align: center;
  margin-bottom: 10px;
}

.modal-card h2 {
  font-size: 20px;
  text-align: center;
  margin-bottom: 6px;
  color: #111827;
}

.modal-card p {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 18px;
}

.summary-box {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
}
.summary-item:last-child {
  margin-bottom: 0;
}
.summary-item .label {
  color: var(--text-muted);
  font-weight: 500;
}
.summary-item .value {
  font-weight: 600;
  color: #111827;
  text-align: right;
}

.modal-actions {
  display: flex;
  gap: 12px;
}
.modal-actions .btn {
  width: 50%;
}

/* Status Tags & Success Screen */
.text-center { text-align: center; }
.success-icon { font-size: 54px; margin-bottom: 12px; }
.status-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
}
.tag {
  display: inline-block;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 20px;
  font-weight: 600;
}
.tag-telegram { background: #E0F2FE; color: #0369A1; }
.tag-sheets { background: #D1FAE5; color: #047857; }

.hidden { display: none !important; }
.mt-4 { margin-top: 16px; }

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Admin Table Styling */
body.admin-body {
  background: #F3F4F6 !important;
  display: block;
  padding: 40px 20px;
}
.admin-container {
  max-width: 1000px;
  margin: 0 auto;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.admin-header h1 { font-size: 24px; color: #111827; }
.admin-header p { font-size: 14px; color: var(--text-muted); }
.table-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}
.table-responsive { overflow-x: auto; }
.leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}
.leads-table th {
  background: #F9FAFB;
  padding: 14px 18px;
  font-weight: 600;
  color: #4B5563;
  border-bottom: 1px solid #E5E7EB;
}
.leads-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #E5E7EB;
  color: #374151;
}
.leads-table tr:hover {
  background: #F9FAFB;
}
.font-bold { font-weight: 600; }
