/* ==========================================================================
   Consultancy Portal Design System — Premium Dynamic Form Theme
   ========================================================================== */

/* Variables & Design Tokens */
:root {
  /* Brand Palette */
  --clr-bg-gradient: radial-gradient(circle at 20% 20%, #1e1b4b 0%, #0f172a 50%, #080c14 100%);
  --clr-card-bg: #ffffff;
  --clr-card-border: rgba(226, 232, 240, 0.9);

  --clr-primary-500: #6366f1;
  --clr-primary-600: #4f46e5;
  --clr-primary-700: #4338ca;
  --clr-primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #06b6d4 100%);
  --clr-primary-glow: rgba(79, 70, 229, 0.18);

  --clr-text-main: #0f172a;
  --clr-text-muted: #475569;
  --clr-text-light: #94a3b8;

  --clr-input-bg: #f8fafc;
  --clr-input-border: #cbd5e1;
  --clr-input-focus: #4f46e5;

  --clr-error: #dc2626;
  --clr-error-bg: #fef2f2;
  --clr-error-border: #fca5a5;

  --clr-success: #059669;
  --clr-success-bg: #ecfdf5;
  --clr-success-border: #a7f3d0;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Elevation & Layering */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  --shadow-glow: 0 10px 25px -5px rgba(79, 70, 229, 0.35);

  /* Layout & Animation Tokens */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--clr-bg-gradient);
  background-attachment: fixed;
  color: var(--clr-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  line-height: 1.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Main Layout Container */
.app-container {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
}

/* Card Container */
.card {
  background: var(--clr-card-bg);
  border: 1px solid var(--clr-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* Header & Consultancy Branding */
.form-header {
  padding: 2.5rem 2.5rem 1.75rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  position: relative;
}

.header-logo-wrapper {
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-logo-img {
  max-height: 70px;
  max-width: 260px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.form-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--clr-text-main);
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.form-header p {
  color: var(--clr-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.form-body {
  padding: 2.25rem 2.5rem 2.75rem 2.5rem;
}

/* Section Banners */
.section-banner {
  background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
  border-left: 4px solid var(--clr-primary-600);
  padding: 0.85rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 2.25rem 0 1.35rem 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.section-banner:first-of-type {
  margin-top: 0;
}

.section-banner h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--clr-text-main);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* Form Controls & Inputs */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--clr-text-main);
  margin-bottom: 0.45rem;
}

.required-asterisk {
  color: var(--clr-error);
  margin-left: 0.2rem;
  font-weight: 700;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: var(--font-family);
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--clr-text-main);
  background-color: var(--clr-input-bg);
  border: 1.5px solid var(--clr-input-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.form-control::placeholder {
  color: var(--clr-text-light);
  font-weight: 400;
}

.form-control:hover {
  border-color: #94a3b8;
  background-color: #ffffff;
}

.form-control:focus {
  background-color: #ffffff;
  border-color: var(--clr-input-focus);
  box-shadow: 0 0 0 4px var(--clr-primary-glow);
}

.form-control:disabled {
  background-color: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.85;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234F46E5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.15rem;
  padding-right: 2.75rem;
  cursor: pointer;
}

/* Dynamic Educational Cards */
.education-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-top: 3.5px solid var(--clr-primary-600);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.education-card:hover {
  border-color: #cbd5e1;
  border-top-color: var(--clr-primary-600);
  box-shadow: var(--shadow-md);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.education-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e2e8f0;
}

.education-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--clr-primary-700);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-add-education {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  border: 2px dashed var(--clr-primary-500);
  color: var(--clr-primary-600);
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.925rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 2rem;
  transition: all var(--transition-fast);
}

.btn-add-education:hover {
  background: rgba(99, 102, 241, 0.06);
  border-color: var(--clr-primary-700);
  color: var(--clr-primary-700);
  transform: translateY(-1px);
}

.btn-remove-education {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-remove-education:hover {
  background: #fee2e2;
  color: #b91c1c;
}

/* Action Buttons Group & Main Submit */
.action-buttons-group {
  margin-top: 2.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-family);
  font-size: 0.975rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  border: none;
  outline: none;
  user-select: none;
}

.btn-primary {
  background: var(--clr-primary-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -5px rgba(79, 70, 229, 0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: #ffffff;
  color: var(--clr-primary-600);
  border: 1.5px solid var(--clr-primary-500);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  color: var(--clr-text-muted);
  border: 1.5px solid var(--clr-input-border);
}

.btn-outline:hover {
  background: #f8fafc;
  color: var(--clr-text-main);
  border-color: #94a3b8;
}

/* Spinner Animation */
.spinner {
  width: 1.15rem;
  height: 1.15rem;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Form Error Validation Styles */
.form-group.has-error .form-control {
  border-color: var(--clr-error);
  background-color: var(--clr-error-bg);
}

.form-group.has-error .form-control:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.error-message {
  color: var(--clr-error);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.35rem;
  display: none;
}

.form-group.has-error .error-message {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Status Screens (Success & Error) */
.status-screen {
  display: none;
  text-align: center;
  padding: 3rem 2rem;
}

.status-screen.is-active {
  display: block;
  animation: fadeIn 0.35s ease-out;
}

.status-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

.status-icon--success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.status-icon--error {
  background: linear-gradient(135deg, #dc2626, #f43f5e);
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(220, 38, 38, 0.4);
}

.status-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--clr-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.status-message {
  color: var(--clr-text-muted);
  font-size: 0.975rem;
  max-width: 500px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
}

.success-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Initial Page Preloader */
.page-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.45s ease;
}

.page-preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.preloader-spinner {
  width: 3rem;
  height: 3rem;
  border: 3.5px solid rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  border-top-color: var(--clr-primary-500);
  animation: spin 0.8s linear infinite;
}

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

  .form-header {
    padding: 2rem 1.5rem 1.25rem 1.5rem;
  }

  .form-header h1 {
    font-size: 1.5rem;
  }

  .form-body {
    padding: 1.5rem 1.25rem 2rem 1.25rem;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .form-group[style*="grid-column: span 2"] {
    grid-column: span 1 !important;
  }

  .success-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}