/*

 */

/* ===== CSS Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary-color: #5f9ea0;
  --secondary-color: #ffffff;
  --accent-color: #1a1a2e;
  --font-family: 'Inter', Helvetica, Arial, sans-serif;
  --border-radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --max-width: 720px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: var(--font-family);
  background-color: #f4f6f9;
  color: var(--accent-color);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== HEADER / LOGO ===== */
.app-header {
  background: white;
  border-bottom: 1px solid #e8ecf1;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.header-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.logo-container {
  display: flex;
  align-items: center;
}
.app-header .logo {
  max-height: 48px;
  width: auto;
  display: block;
}
.app-header .brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}
.header-tagline {
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  margin: 32px auto;
  padding: 0 20px;
  width: 100%;
}

/* ===== FLASH MESSAGES ===== */
.flash {
  padding: 14px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  box-shadow: var(--shadow-sm);
}
.flash-notice { background-color: #ecfdf5; color: #065f46; }
.flash-alert { background-color: #fef2f2; color: #991b1b; }

/* ===== WIZARD CARD ===== */
.wizard-card {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 44px 48px;
  margin-bottom: 30px;
  border: 1px solid rgba(0,0,0,0.04);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-bottom: 36px;
  position: relative;
}
.progress-step {
  display: flex;
  align-items: center;
  gap: 6px;
}
.progress-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e8ecf1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  transition: var(--transition);
  position: relative;
}
.progress-dot.completed {
  background-color: var(--primary-color);
  color: white;
}
.progress-dot.completed::after {
  content: '✓';
  font-size: 0.8rem;
}
.progress-dot.active {
  background-color: var(--primary-color);
  color: white;
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(95,158,160,0.2);
}
.progress-connector {
  width: 24px;
  height: 2px;
  background-color: #e8ecf1;
  transition: var(--transition);
}
.progress-connector.completed {
  background-color: var(--primary-color);
}

/* ===== TYPOGRAPHY ===== */
.wizard-card h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--accent-color);
  letter-spacing: -0.03em;
  text-align: center;
}
.wizard-card .step-subtitle {
  text-align: center;
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 32px;
}
.wizard-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wizard-card h3 .section-icon {
  font-size: 1.2rem;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font-family);
  background-color: #fafbfc;
  color: var(--accent-color);
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(95,158,160,0.12);
}
.form-group input::placeholder { color: #94a3b8; }

/* ===== TOGGLE BUTTONS ===== */
.toggle-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 16px;
}
.toggle-btn {
  padding: 10px 24px;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-family);
  font-weight: 600;
  color: #64748b;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.toggle-btn:hover {
  border-color: #cbd5e1;
  color: var(--accent-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.toggle-btn.selected {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(95,158,160,0.3);
  transform: translateY(-1px);
}

/* ===== WORK TYPE CARDS ===== */
.work-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.work-type-card {
  border: 2px solid #e8ecf1;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  overflow: visible;
  background: white;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.work-type-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}
.work-type-card.selected {
  border-color: var(--primary-color);
  box-shadow: 0 8px 24px rgba(95,158,160,0.2);
  transform: translateY(-2px);
}
.work-type-card.selected::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
.work-type-card .work-icon {
  font-size: 2.8rem;
  padding: 24px 0 8px;
  background: transparent;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-type-card .work-label {
  padding: 8px 12px 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
}

/* ===== OWNER SECTION ===== */
.owner-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary-color);
  border-radius: 0 12px 12px 0;
  padding: 24px 28px;
  margin-bottom: 20px;
  transition: var(--transition);
}
.owner-section .owner-header {
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin: -24px -28px 20px -28px;
  padding: 16px 28px;
  border-bottom: 1px solid #e8ecf1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.owner-section .owner-header .remove-owner-btn {
  background: none;
  border: 1px solid #fca5a5;
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-family);
  transition: var(--transition);
}
.owner-section .owner-header .remove-owner-btn:hover {
  background: #fef2f2;
}

/* Add Owner Button */
.add-owner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-family);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 24px;
}
.add-owner-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(95,158,160,0.04);
}
.add-owner-btn .plus-icon {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ===== INFO & WARNING BOXES ===== */
.warning-box, .info-box {
  border-radius: 10px;
  padding: 14px 18px;
  border: none;
  font-weight: 500;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.55;
  margin-bottom: 20px;
}
.warning-box {
  background-color: #fffbeb;
  color: #92400e;
}
.info-box {
  background-color: #eff6ff;
  color: #1e40af;
}
.warning-box::before { content: '⚠'; font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.info-box::before { content: 'ℹ'; font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ===== BUTTONS ===== */
.btn {
  padding: 12px 32px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: var(--font-family);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.01em;
}
.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 8px rgba(95,158,160,0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(95,158,160,0.35);
  filter: brightness(1.05);
}
.btn-secondary {
  background-color: white;
  border: 2px solid #e2e8f0;
  color: #64748b;
}
.btn-secondary:hover {
  border-color: #cbd5e1;
  color: var(--accent-color);
  background-color: #f8fafc;
}
.btn-success {
  background-color: #059669;
  color: white;
  box-shadow: 0 2px 8px rgba(5,150,105,0.25);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(5,150,105,0.35);
  filter: brightness(1.05);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}
.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}
.btn-lg {
  padding: 16px 48px;
  font-size: 1rem;
}

/* ===== WIZARD NAVIGATION ===== */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
}

/* ===== REVIEW SECTION ===== */
.review-section {
  margin-bottom: 28px;
}
.review-section h3 {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
  margin-top: 0;
}
.review-table {
  width: 100%;
  border-collapse: collapse;
}
.review-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  font-size: 0.9rem;
}
.review-table td:first-child {
  font-weight: 600;
  width: 40%;
  color: #64748b;
}

/* ===== RESULT PAGE ===== */
.result-page {
  text-align: center;
}
.result-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}
.result-page h2 {
  margin-bottom: 12px;
}
.result-page .result-subtitle {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 36px;
}
.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}
.pdf-preview-container {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: var(--shadow-md);
  background: #f8fafc;
}
.pdf-preview-container iframe {
  width: 100%;
  height: 500px;
  border: none;
}
.pdf-preview-fallback {
  padding: 40px;
  text-align: center;
  color: #64748b;
}
.pdf-preview-fallback .file-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ===== FOOTER ===== */
.app-footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid #e8ecf1;
  background: white;
}
.app-footer p {
  color: #94a3b8;
  font-size: 0.82rem;
}
.app-footer .footer-sub {
  font-size: 0.72rem;
  margin-top: 4px;
  color: #cbd5e1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .wizard-card { padding: 28px 24px; }
  .header-content { padding: 10px 16px; }
  .header-tagline { display: none; }
  .app-header .logo { max-height: 36px; }
  .work-types { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .form-group input[type="text"],
  .form-group input[type="email"],
  .form-group select { max-width: 100%; }
  .wizard-nav { flex-direction: column-reverse; gap: 12px; }
  .wizard-nav .btn { width: 100%; }
  .progress-dot { width: 28px; height: 28px; font-size: 0.7rem; }
  .progress-connector { width: 12px; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
}

/* ===== ADMIN STYLES ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 250px;
  background: #1e293b;
  color: white;
  padding: 20px 0;
  flex-shrink: 0;
}
.admin-sidebar h2 {
  padding: 0 20px 20px;
  border-bottom: 1px solid #334155;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.admin-sidebar nav a {
  display: block;
  padding: 12px 20px;
  color: #94a3b8;
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.9rem;
}
.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
  background: #334155;
  color: white;
}
.admin-main {
  flex: 1;
  padding: 30px;
  background: #f4f6f9;
}
.admin-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid rgba(0,0,0,0.04);
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}
.admin-table th { background: #f8fafc; font-weight: 600; color: #475569; }
.admin-table tr:hover { background: #f8fafc; }
.admin-form .form-group { margin-bottom: 20px; }
.admin-form label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.9rem; }
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="tel"],
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form input[type="color"],
.admin-form select,
.admin-form textarea {
  width: 100%;
  max-width: 500px;
  padding: 10px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-family);
  transition: var(--transition);
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(95,158,160,0.1);
}
.admin-actions { display: flex; gap: 10px; margin-bottom: 20px; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-info { background: #eff6ff; color: #1e40af; }
.login-container { max-width: 400px; margin: 100px auto; padding: 0 20px; }
.login-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 40px;
}
.login-card h2 { text-align: center; margin-bottom: 30px; color: #1e293b; }
.color-preview {
  display: inline-block;
  width: 30px;
  height: 20px;
  border: 1px solid #ccc;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 5px;
}

/* Admin password change section */
.admin-password-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #e8ecf1;
}
.admin-password-section h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1e293b;
}
