/* ==========================================================================
   Future Of Work Forum Africa — Digital Card Creator
   Brand Aesthetics: Premium, Editorial, Executive, Modern African
   Colors: Olive Green, Warm Gold, Warm Off-White, Near Black
   Layout: Centered Single-Column Card
   ========================================================================== */

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

:root {
  --primary: #16ac95;      /* Dark Teal */
  --primary-hover: #128e7b;/* Darker Teal */
  --secondary: #61ddcb;    /* Bright Teal/Cyan */
  --secondary-light: #acfbf3; /* Mint/Light Teal */
  --background: #e6f1f1;   /* Very Light Ice Teal */
  --text: #2a282c;         /* Dark Slate */
  --muted: #59585a;        /* Dark Gray */
  --card: #FFFFFF;         /* White Card Background */
  --border: #a5c0bc;       /* Sage Gray Border */
  --error: #D35C4A;        /* Warm Crimson Error */

  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 0.75rem;
  --radius-md: 1.5rem;
  
  --shadow-sm: 0 2px 8px rgba(42, 40, 44, 0.02);
  --shadow-md: 0 12px 32px rgba(22, 172, 149, 0.06), 0 4px 16px rgba(165, 192, 188, 0.15);
  --shadow-lg: 0 24px 64px rgba(42, 40, 44, 0.05), 0 8px 32px rgba(22, 172, 149, 0.05);
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html, body {
  min-height: 100%;
  background-color: var(--background);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Background Layer --- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Premium African Geometric Chevron Pattern */
.bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M72 64L40 32L8 64' stroke='%2316ac95' stroke-width='2.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40 0L72 32M40 0L8 32' stroke='%2361ddcb' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}

/* --- Header --- */
.top-header {
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 50;
  padding: 2.5rem 2rem;
  display: flex;
  justify-content: center;
}

@media (min-width: 768px) {
  .top-header {
    justify-content: flex-start;
    padding: 3rem 4rem;
  }
}

.brand-logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.logo-main {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.logo-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

/* --- Main Layout --- */
.main-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8.5rem 1.5rem 4rem;
}

/* --- Executive Card --- */
.executive-card {
  background-color: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 3.5rem 3rem;
  width: 100%;
  max-width: 34rem;
  position: relative;
  overflow: hidden;
}

/* Premium Top Gradient Border Line */
.executive-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

@media (max-width: 500px) {
  .executive-card {
    padding: 2.5rem 1.5rem;
  }
}

/* --- Form Header --- */
.form-header {
  margin-bottom: 2.5rem;
  text-align: left;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--secondary-light);
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 1rem;
  border-radius: 2rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(97, 221, 203, 0.25);
}

.event-badge svg {
  width: 0.9rem;
  height: 0.9rem;
}

.form-header h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.form-header p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--muted);
}

/* --- Sections & Fields --- */
.form-section {
  border: none;
  margin-bottom: 2.5rem;
  width: 100%;
}

.section-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 0.4rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.field-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
}

.field-group label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.required {
  color: var(--error);
  margin-left: 0.15rem;
}

/* Grids */
.fields-grid {
  display: grid;
  gap: 1.25rem;
}

.two-col {
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 500px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Input Wrappers */
.input-wrapper, .email-composite {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.input-wrapper:focus-within, .email-composite:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(146, 176, 121, 0.12);
}

.input-wrapper.disabled {
  background-color: var(--background);
  opacity: 0.8;
  cursor: not-allowed;
}

.input-wrapper.disabled input {
  cursor: not-allowed;
  color: var(--muted);
}

.input-wrapper.has-error, .email-composite.has-error {
  border-color: var(--error);
}

.input-wrapper.has-error:focus-within, .email-composite.has-error:focus-within {
  box-shadow: 0 0 0 4px rgba(211, 92, 74, 0.12);
}

.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 1rem;
  color: var(--primary);
  opacity: 0.85;
}

.input-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.input-wrapper input, .email-composite input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
}

.input-wrapper input::placeholder, .email-composite input::placeholder {
  color: var(--muted);
  opacity: 0.55;
}

/* Composite Elements */
.phone-prefix {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--background);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0 1rem;
  border-right: 1.5px solid var(--border);
  align-self: stretch;
  user-select: none;
}

.phone-prefix svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--primary);
}

/* Textarea wrapper */
.textarea-wrapper {
  position: relative;
}

.textarea-icon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--primary);
  opacity: 0.85;
  pointer-events: none;
}

.textarea-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}

.textarea-wrapper textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  padding: 0.85rem 1rem 0.85rem 2.6rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 7.5rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.textarea-wrapper textarea::placeholder {
  color: var(--muted);
  opacity: 0.55;
}

.textarea-wrapper textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(146, 176, 121, 0.12);
}

/* Validation Errors */
.field-error {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--error);
  margin-top: 0.35rem;
  min-height: 1.1rem;
  opacity: 0;
  transform: translateY(-5px);
  transition: var(--transition);
}

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

/* --- Submit Button --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1.1rem 2rem;
  border: none;
  border-radius: var(--radius-sm);
  background-color: var(--primary);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(146, 176, 121, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(146, 176, 121, 0.35), 0 0 0 1px var(--secondary);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(146, 176, 121, 0.25);
}

.btn-primary:disabled {
  background-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.spinner {
  width: 1.2rem;
  height: 1.2rem;
  animation: spin 0.8s linear infinite;
  color: currentColor;
}

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

.btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Footer Logo --- */
.form-footer {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
  border-top: 1.5px solid var(--border);
  padding-top: 1.5rem;
  width: 100%;
}

.footer-logo {
  height: 2.35rem;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  transition: var(--transition);
}

.footer-logo:hover {
  opacity: 1;
}

/* --- Success Wrapper --- */
.success-wrapper {
  width: 100%;
  max-width: 34rem;
}

.success-card {
  text-align: center;
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.success-icon-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background-color: rgba(146, 176, 121, 0.08);
  border: 1.5px solid rgba(146, 176, 121, 0.25);
  color: var(--primary);
  margin-bottom: 2rem;
  animation: pulseRing 2s infinite ease-in-out;
}

.success-icon-ring svg {
  width: 2.5rem;
  height: 2.5rem;
}

.success-card h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.success-card p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.success-contact {
  width: 100%;
  border-top: 1.5px dashed var(--border);
  padding-top: 2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

.success-contact strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.success-contact a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition);
}

.success-contact a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* --- Animations --- */
.fade-in {
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.scale-in {
  animation: scaleIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(146, 176, 121, 0.15);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(146, 176, 121, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(146, 176, 121, 0);
  }
}

/* Utilities */
[hidden] {
  display: none !important;
}