/* =========================
   ROOT VARIABLES (BRAND)
========================= */
:root{
  --primary:#16a34a;
  --primary-dark:#15803d;
  --primary-light:#dcfce7;

  --text:#0f172a;
  --muted:#64748b;

  --bg:#f1f5f9;
  --white:#ffffff;

  --border:#e2e8f0;
  --danger:#ef4444;

  --shadow:0 10px 30px rgba(0,0,0,0.08);
  --radius:14px;
}

/* =========================
   GLOBAL RESET
========================= */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  font-family:'Poppins', sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
}

/* =========================
   HEADER
========================= */
header{
  background:linear-gradient(135deg,var(--primary-dark),var(--primary));
  color:#fff;
  text-align:center;
  padding:50px 20px;
}

header h1{
  font-size:2.4rem;
  font-weight:700;
  margin-bottom:8px;
}

header p{
  opacity:0.9;
  font-size:1rem;
}

/* =========================
   MAIN WRAPPER
========================= */
.container-main{
  max-width:1300px;
  width:95%;
  margin:auto;
  padding:30px 0 70px;
}

/* =========================
   PROGRESS SECTION
========================= */
.progress-container{
  background:var(--white);
  padding:20px;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  margin-bottom:25px;
}

.progress-bar{
  width:100%;
  height:10px;
  background:#e5e7eb;
  border-radius:999px;
  overflow:hidden;
  margin-bottom:15px;
}

.progress-fill{
  height:100%;
  width:10%;
  background:linear-gradient(90deg,var(--primary),#22c55e);
  transition:0.4s ease;
}

/* Step Indicators FIX */
.step-indicators{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
}

.step-indicator{
  font-size:12px;
  padding:7px 12px;
  border-radius:999px;
  background:#f1f5f9;
  border:1px solid var(--border);
  cursor:pointer;
  color:var(--muted);
  transition:0.25s;
  user-select:none;
  white-space:nowrap;
}

.step-indicator:hover{
  border-color:var(--primary);
  color:var(--primary-dark);
}

.step-indicator.active{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}

/* =========================
   FORM CONTAINER
========================= */
.form-container{
  display:grid;
  grid-template-columns:1.3fr 1fr;
  gap:25px;
}

/* =========================
   FORM STEP
========================= */
.form-step{
  display:none;
  background:var(--white);
  padding:25px;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  animation:fadeIn 0.3s ease;
}

.form-step.active{
  display:block;
}

.form-step h2{
  font-size:1.4rem;
  margin-bottom:18px;
  color:var(--primary-dark);
}

/* Inputs FIX */
input, textarea, select{
  width:100%;
  padding:12px 14px;
  margin-bottom:12px;
  border:1px solid var(--border);
  border-radius:10px;
  font-size:14px;
  outline:none;
  transition:0.2s ease;
}

input:focus, textarea:focus, select:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-light);
}

/* TEXT WRAP FIX (IMPORTANT FOR PREVIEW BUGS) */
textarea{
  resize:vertical;
  word-break:break-word;
}

/* Cards */
.card{
  background:#f8fafc;
  border:1px solid var(--border);
  padding:15px;
  border-radius:12px;
  margin-bottom:15px;
}

/* =========================
   ADD BUTTON
========================= */
.btn-add{
  background:var(--primary-light);
  color:var(--primary-dark);
  border:1px dashed var(--primary);
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  font-weight:500;
  width:100%;
  transition:0.2s;
  margin-bottom:12px;
}

.btn-add:hover{
  background:#bbf7d0;
}

/* =========================
   PHONE SYSTEM FIX (NEW)
========================= */
#phoneContainer{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:10px;
}

.phone-item{
  display:flex;
  gap:10px;
  align-items:center;
}

.phone-item input{
  flex:1;
}

/* =========================
   NAVIGATION
========================= */
.form-navigation{
  grid-column:1 / -1;
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:20px;
  background:var(--white);
  padding:18px;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}

/* Buttons */
.btn{
  padding:12px 18px;
  border:none;
  border-radius:10px;
  cursor:pointer;
  font-weight:500;
}

.btn-primary{background:var(--primary);color:#fff;}
.btn-primary:hover{background:var(--primary-dark);}

.btn-secondary{background:#e2e8f0;}
.btn-secondary:hover{background:#cbd5e1;}

.btn-success{background:#22c55e;color:#fff;}
.btn-success:hover{background:#16a34a;}

/* =========================
   CV PREVIEW FIX (IMPORTANT)
========================= */
.cv-preview-section{
  background:#fff;
  padding:20px;
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  position:sticky;
  top:20px;
}

.preview-a4{
  background:#fff;
  padding:20px;
  border:1px solid var(--border);
  border-radius:10px;
  min-height:400px;

  /* FIX FOR MISSING TEXT */
  word-wrap:break-word;
  overflow-wrap:break-word;
}

/* CV CONTENT */
.cv-header{
  text-align:center;
  border-bottom:2px solid var(--primary-light);
  padding-bottom:10px;
  margin-bottom:15px;
}

.cv-name{font-size:1.5rem;font-weight:700;}
.cv-title{color:var(--primary-dark);}

.cv-section{margin-top:15px;}

.cv-section h3{
  color:var(--primary);
  margin-bottom:8px;
  font-size:1rem;
}

.cv-item{margin-bottom:10px;}

.cv-item h4{
  font-size:14px;
  font-weight:600;
}

.details{
  font-size:12px;
  color:var(--muted);
  word-break:break-word;
}

/* =========================
   MODAL FIX
========================= */
.modal{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  justify-content:center;
  align-items:center;
}

.modal-content{
  background:#fff;
  padding:25px;
  border-radius:12px;
  width:300px;
  text-align:center;
  box-shadow:var(--shadow);
}

.modal-buttons{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:15px;
}

.modal-buttons button{
  flex:1;
  padding:10px;
  border:none;
  border-radius:8px;
  cursor:pointer;
}

/* =========================
   VALIDATION
========================= */
.error{border-color:var(--danger)!important;}

.validation-error{
  color:var(--danger);
  font-size:12px;
  margin-top:-8px;
  margin-bottom:10px;
}

/* =========================
   ANIMATION
========================= */
@keyframes fadeIn{
  from{opacity:0;transform:translateY(10px);}
  to{opacity:1;transform:translateY(0);}
}

/* =========================
   RESPONSIVE
========================= */
@media(max-width:1000px){
  .form-container{
    grid-template-columns:1fr;
  }

  .cv-preview-section{
    position:relative;
    top:auto;
  }
}

@media(max-width:600px){
  header h1{font-size:1.6rem;}

  .form-navigation{
    flex-direction:column;
  }

  .step-indicators{
    justify-content:flex-start;
  }
}