:root {
  --primary: #ff9933;
  --secondary: #138808;
  --accent: #ffffff;
  --text: #10233d;
  --muted: #53657a;
  --surface: rgba(255, 255, 255, 0.82);
  --border: rgba(255, 153, 51, 0.25);
  --flag-blue: #000080;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #fff7e6 0%, #ffe1b3 35%, #ffffff 70%, #e6ffe6 100%);
  padding: 24px;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
}

.orb-one {
  width: 320px;
  height: 320px;
  background: rgba(255, 153, 51, 0.35);
  top: -80px;
  left: -80px;
}

.orb-two {
  width: 260px;
  height: 260px;
  background: rgba(19, 136, 8, 0.28);
  bottom: -80px;
  right: -60px;
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
}

.app-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,245,228,0.9));
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 25px 60px rgba(255, 153, 51, 0.18);
  transform: perspective(1400px) rotateX(2deg) rotateY(-3deg);
}

.builder-panel,
.preview-panel {
  border-radius: 22px;
  padding: 20px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.panel-header h1 {
  margin: 4px 0 8px;
  font-size: 1.7rem;
}

.eyebrow {
  margin: 0;
  color: var(--secondary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.panel-text {
  margin: 0 0 16px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(15, 76, 129, 0.15);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: rgba(255,255,255,0.95);
  color: var(--text);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(29, 111, 165, 0.16);
}

.full-width {
  grid-column: 1 / -1;
}

.section-label {
  margin-bottom: 8px;
}

.education-form {
  display: grid;
  gap: 10px;
}

.education-row {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 1.4fr 0.8fr 0.7fr;
  gap: 8px;
}

.education-row label {
  font-size: 0.8rem;
  gap: 4px;
}

.preview-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.preview-card {
  width: 100%;
  max-width: 794px;
  min-height: 1123px;
  background: linear-gradient(135deg, #ffffff, #f2f8ff);
  border: 2px solid #dfeaf5;
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 24px 40px rgba(15, 76, 129, 0.2);
  transform: translateZ(30px);
  transition: transform 0.25s ease;
}

.preview-card.pulse {
  transform: scale(1.01) translateZ(40px);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #dce9f5;
}

.preview-person {
  flex: 1;
}

.preview-photo-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #dce9f5;
  background: linear-gradient(135deg, #eef6ff, #dce9f5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preview-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.preview-header h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.preview-header p,
.preview-section p,
.preview-section div {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.preview-contact {
  text-align: right;
  font-size: 0.84rem;
  flex: 1;
}

.preview-section {
  padding-top: 12px;
}

.preview-section h3 {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.96rem;
}

.declaration {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #dce9f5;
}

.declaration-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.declaration-footer p {
  margin: 2px 0;
}

.edu-preview-item {
  padding: 6px 0;
  border-bottom: 1px dashed #dce9f5;
}

.edu-preview-item strong {
  display: block;
  color: var(--text);
  margin-bottom: 2px;
}

.edu-preview-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.action-bar {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
  color: white;
  box-shadow: 0 10px 20px rgba(15, 76, 129, 0.18);
}

.btn.primary { background: linear-gradient(135deg, var(--primary), #ff7a00); }
.btn.secondary { background: linear-gradient(135deg, var(--flag-blue), #1e40af); }
.btn.success { background: linear-gradient(135deg, var(--secondary), #2e8b57); }

@media (max-width: 920px) {
  .app-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .education-row { grid-template-columns: 1fr; }
  .preview-header { flex-direction: column; }
  .preview-contact { text-align: left; }
  .action-bar { justify-content: stretch; }
  .btn { flex: 1; }
}

@media print {
  body { background: #fff; padding: 0; }
  .bg-orb, .builder-panel, .action-bar { display: none !important; }
  .app-card { display: block; background: #fff; box-shadow: none; transform: none; padding: 0; }
  .preview-panel { display: block; padding: 0; }
  .preview-card {
    max-width: none;
    min-height: 100%;
    box-shadow: none;
    border: 1px solid #dce9f5;
    border-radius: 0;
    transform: none;
    padding: 20mm;
  }
}
