/* ═══════════════════════════════════════════════════════════════
   DXC Card Creator — Styles
   Brand:  DXC Purple #5F249F · Slate #444444 · White #FFFFFF
   Fonts:  DM Sans (body) · Outfit (headings)
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --clr-primary:    #6599ee; /* Blue */
  --clr-secondary:  #8793cc; /* Periwinkle */
  --clr-orange:     #fe8455; /* Orange */
  --clr-coral:      #ed8163; /* Coral */
  
  --clr-gradient:   linear-gradient(135deg, #6599ee, #fe8455);
  --clr-gradient-alt: linear-gradient(135deg, #8793cc, #ed8163);

  --clr-accent-1:   #ed8163;
  --clr-accent-2:   #fe8455;
  --clr-accent-3:   #ffa966;
  --clr-accent-4:   #c3888f;
  --clr-accent-5:   #d98578;
  --clr-accent-6:   #a78dab;
  
  --clr-cream:      #f6f3f0;
  --clr-white:      #ffffff;
  --clr-border:     #e2e8f0;
  --clr-muted:      #f1f5f9;
  --clr-muted-fg:   #64748b;
  --clr-destructive:#ef4444;
  --clr-ring:       #6599ee;

  --color-gradient-start: #6599ee;
  --color-gradient-mid1:  #8793cc;
  --color-gradient-mid2:  #ed8163;
  --color-gradient-end:   #fe8455;

  --font-body:    'DM Sans', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --secondary:    'Outfit';

  --font-family-sans-serif: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --radius:       1rem;
  --shadow-card:  0 10px 40px rgba(101, 153, 238, 0.12), 0 10px 40px rgba(254, 132, 85, 0.08);
  --shadow-lg:    0 25px 70px rgba(101, 153, 238, 0.15), 0 15px 30px rgba(254, 132, 85, 0.1);
}

.headline-gradient {
  font-family: var(--secondary), sans-serif;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(90deg, var(--color-gradient-start) 0%, var(--color-gradient-mid1) 25%, var(--color-gradient-mid2) 50%, var(--color-gradient-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  display: inline-block;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--secondary), sans-serif;
  background: var(--clr-cream);
  color: var(--clr-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(132, 201, 189, 0.3);
  color: var(--clr-primary);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.bg-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150vw;
  max-width: 900px;
  height: auto;
  object-fit: contain;
  opacity: 0.08;
  pointer-events: none;
}

.bg-gradient-overlay {
  position: absolute;
  top: 0; right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(to left, rgba(255,255,255,0.4), transparent);
}

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

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

.logo {
  height: 3.5rem;
  width: auto;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.04));
}

/* ── Main Content ─────────────────────────────────────────────── */
.main-content {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1rem 3rem;
}

/* ── Glass Card ───────────────────────────────────────────────── */
.glass-card {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.50);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  width: 100%;
  max-width: 36rem;
}

@media (min-width: 768px) {
  .glass-card { padding: 2.5rem; }
}

/* ── Form Header ──────────────────────────────────────────────── */
.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.header-image {
  width: 6rem;
  height: auto;
  margin: 0 auto 1.5rem auto;
  display: block;
}

.form-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--clr-primary);
  margin-bottom: 0.5rem;
}

.form-header p {
  font-size: 0.875rem;
  color: var(--clr-muted-fg);
}

/* ── Form Sections ────────────────────────────────────────────── */
fieldset {
  border: none;
  margin-bottom: 2rem;
}

.section-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--clr-muted-fg);
  margin-bottom: 1rem;
}

/* ── Field Groups ─────────────────────────────────────────────── */
.field-group {
  margin-bottom: 0.75rem;
}

.field-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--clr-primary);
}

.required {
  color: var(--clr-destructive);
}

/* ── Grid Layouts ─────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

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

.fields-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Input Wrapper ────────────────────────────────────────────── */
.input-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  background: var(--clr-white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: all 0.25s ease;
}

.input-wrapper:focus-within {
  border-color: var(--clr-ring);
  box-shadow: 0 0 0 3px rgba(132, 201, 189, 0.25);
}

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

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

.input-wrapper.has-error {
  border-color: var(--clr-destructive);
}

.input-wrapper.has-error:focus-within {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.input-icon {
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
  color: var(--clr-secondary);
  flex-shrink: 0;
}

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

.input-wrapper input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--clr-primary);
}

.input-wrapper input::placeholder {
  color: var(--clr-muted-fg);
  opacity: 0.6;
}

/* ── Email Composite ──────────────────────────────────────────── */
.email-composite {
  display: flex;
  align-items: center;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  background: var(--clr-white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: all 0.25s ease;
}

.email-composite:focus-within {
  border-color: var(--clr-ring);
  box-shadow: 0 0 0 3px rgba(132, 201, 189, 0.25);
}

.email-composite.has-error {
  border-color: var(--clr-destructive);
}

.email-composite .input-icon {
  padding-left: 0.75rem;
}

.email-composite input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--clr-primary);
  min-width: 0;
}

.email-composite input::placeholder {
  color: var(--clr-muted-fg);
  opacity: 0.6;
}

.email-suffix {
  background: var(--clr-muted);
  color: var(--clr-muted-fg);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem;
  border-left: 1px solid var(--clr-border);
  white-space: nowrap;
  user-select: none;
}

.phone-prefix {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--clr-muted);
  color: var(--clr-muted-fg);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 0.75rem;
  border-right: 1px solid var(--clr-border);
  white-space: nowrap;
  user-select: none;
  align-self: stretch;
}
.phone-prefix svg {
  width: 1.125rem;
  height: 1.125rem;
}

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

.textarea-icon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: var(--clr-muted-fg);
  pointer-events: none;
}

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

.textarea-wrapper textarea {
  width: 100%;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  background: var(--clr-white);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  padding: 1rem 1rem 1rem 2.75rem;
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--clr-primary);
  resize: vertical;
  min-height: 7.5rem;
  outline: none;
  transition: all 0.25s ease;
}

.textarea-wrapper textarea::placeholder {
  color: var(--clr-muted-fg);
  opacity: 0.6;
}

.textarea-wrapper textarea:focus {
  border-color: var(--clr-ring);
  box-shadow: 0 0 0 3px rgba(132, 201, 189, 0.25);
}

/* ── Validation Error ─────────────────────────────────────────── */
.field-error {
  font-size: 0.75rem;
  color: var(--clr-destructive);
  margin-top: 0.25rem;
  min-height: 1rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.2s ease;
}

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

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--clr-gradient);
  color: var(--clr-white);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(101, 153, 238, 0.3);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--clr-gradient-alt);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(26, 52, 49, 0.25);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 52, 49, 0.2);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary:disabled::before { opacity: 0; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  border: 2px solid var(--clr-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--clr-primary);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-outline:hover {
  background: var(--clr-primary);
  color: var(--clr-white);
  border-color: var(--clr-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26, 52, 49, 0.2);
}

/* ── Spinner ──────────────────────────────────────────────────── */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  animation: spin 0.8s linear infinite;
}

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

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

/* ── Success Card ─────────────────────────────────────────────── */
.success-wrapper {
  width: 100%;
  max-width: 32rem;
}

.success-card {
  text-align: center;
  padding: 2.5rem 2rem !important;
}

@media (min-width: 768px) {
  .success-card { padding: 4rem !important; }
}

.success-icon-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: rgba(132, 201, 189, 0.15);
  margin-bottom: 2rem;
}

.success-icon-ring svg {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--clr-secondary);
}

.success-card h1 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--clr-primary);
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .success-card h1 { font-size: 2.25rem; }
}

.success-card p {
  font-size: 1.125rem;
  color: var(--clr-muted-fg);
  margin-bottom: 2rem;
  line-height: 1.6;
}

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

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

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

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

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

.success-contact {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--clr-border);
  font-size: 0.9375rem;
  color: var(--clr-muted-fg);
  line-height: 1.6;
  text-align: center;
}

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

.success-contact a {
  color: var(--clr-primary);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.success-contact a:hover {
  opacity: 0.7;
}
