/* 
  CORDAMI Censo Agropecuario - Stylesheet
  Aesthetics: Forest Green (#194a2b) & Gold (#c9a227)
*/

:root {
  --primary: #006525;
  --primary-hover: #123720;
  --primary-light: rgba(25, 74, 43, 0.08);
  --secondary: #c9a227;
  --secondary-hover: #a3811f;
  --secondary-light: rgba(201, 162, 39, 0.12);
  --background: #fdfdfb;
  --card-background: #ffffff;
  --text-main: #1c1917;
  --text-muted: #5b6960;
  --border: #d6d3d1;
  --border-focus: #194a2b;
  --error: #ef4444;
  --success: #22c55e;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --font-sans: 'Inter', sans-serif;
  --font-header: 'Montserrat', sans-serif;
  --radius: 6px;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 50px;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Top Navigation Bar */
.top-navbar {
  background-color: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  height: 65px;
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: nowrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-logo {
  height: 3.5rem;
  width: 3.5rem;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-size: 1rem;
}

.brand-name {
  font-family: var(--font-header);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  color: var(--primary);
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--secondary);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  flex-wrap: nowrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #374151;
  background-color: #ffffff;
  border: 1.5px solid #e5e7eb;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  height: 30px;
  border-radius: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  white-space: nowrap;
}

.nav-links a:hover {
  background-color: #f8fafc;
  color: var(--primary);
  border-color: #cbd5e1;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.nav-links a.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 101, 37, 0.28);
}

.nav-links a.active:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  border-color: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(0, 101, 37, 0.35);
}

.link-ingresar-text {
  display: inline-flex;
  align-items: center;
}

.nav-links a.link-ingresar-text {
  background-color: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.nav-links a.link-ingresar-text:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(0, 101, 37, 0.25);
}

.nav-links a.link-ingresar-text.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* App Layout */
.app-container {
  max-width: 1024px;
  margin: 40px auto;
  padding: 0 20px;
}

/* View Sections Toggle */
.view-section {
  display: none;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* LANDING PAGE HERO */
.landing-hero {
  text-align: center;
  padding: 40px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge-status {
  background-color: #f3ece0;
  color: #483c22;
  border: none;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 20px;
  letter-spacing: 0.2px;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--secondary);
  display: inline-block;
}

.hero-title {
  font-family: var(--font-header);
  font-size: 3.6rem;
  line-height: 1.12;
  color: #1c1917;
  margin-bottom: 24px;
  max-width: 800px;
  letter-spacing: -1.5px;
}

.hero-title .highlight {
  color: var(--primary);
}

.hero-desc {
  font-size: 1.15rem;
  color: #408a5b;
  max-width: 640px;
  line-height: 1.6;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-large {
  padding: 14px 28px;
  font-size: 0.95rem;
  border-radius: 6px;
  font-weight: 700;
}

.section-divider {
  border: 0;
  height: 1px;
  background-color: #e7e5e4;
  margin: 50px 0;
}

/* ==================== EXACT FEATURES DESIGN ==================== */
.features-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  margin-top: 20px;
  text-align: left;
}

.feature-item {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  text-align: center;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.feature-item:hover {
  transform: translateY(-2px);
}

.feature-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.box-green {
  background-color: #e2ede6;
}

.box-gold {
  background-color: #f3ece0;
}

.feature-item h3 {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 700;
  color: #1c1917;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.feature-item p {
  font-family: var(--font-sans);
  font-size: 0.94rem;
  color: #5b6960;
  line-height: 1.6;
}

/* ==================== FORM FLOW DESIGN ==================== */

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 25px;
}

.app-title {
  font-family: var(--font-header);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.app-subtitle {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Progress Indicator (Inside Card Layout) */
.progress-container-new {
  margin-bottom: 25px;
  width: 100%;
}

.progress-labels-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-step-text {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: #408a5b;
}

.progress-title-text {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: #408a5b;
}

.progress-bar-bg-new {
  height: 6px;
  background-color: #e2ede6;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.progress-bar-fill-new {
  height: 100%;
  width: 12.5%;
  background-color: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease-in-out;
}

/* Form Card */
.form-card {
  background-color: var(--card-background);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 30px;
  border: 1px solid #e2e8f0;
  max-width: 760px;
  margin: 0 auto;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.step-header {
  display: none;
}

.step-section-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: #194a2b;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e7e5e4;
  grid-column: span 2;
  margin-top: 15px;
}

.state-static-field {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: #5b6960;
  margin: 5px 0 0 0;
}

.state-static-field strong {
  color: var(--text-main);
  font-weight: 700;
  margin-left: 4px;
}

.section-title {
  font-family: var(--font-header);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 28px;
  margin-bottom: 16px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(25, 74, 43, 0.25);
}

.section-subtitle-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: -10px;
  margin-bottom: 15px;
}

/* Form Grid & Layout */
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.fields-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.fields-grid.cols-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: span 2;
}

.fields-grid.cols-3 .form-group {
  grid-column: auto;
}

/* Form Inputs */
label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.required {
  color: var(--error);
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: #fff;
  transition: all 0.2s ease;
  width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(25, 74, 43, 0.12);
}

.readonly-input {
  background-color: #f1f5f9 !important;
  color: var(--text-muted);
  cursor: not-allowed;
}

.helper-text-under {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 4px;
  display: block;
}

.input-addon-group {
  display: flex;
  gap: 8px;
}

.input-addon-select {
  width: 75px;
  flex-shrink: 0;
}

/* Photo Upload Widget (Exact Proportions) */
.photo-upload-container-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 25px 0;
  width: 100%;
}

.photo-preview-wrapper-new {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1.5px dashed #408a5b;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.photo-preview-wrapper-new:hover {
  background-color: #f1f6f3;
  transform: scale(1.02);
}

.photo-preview-wrapper-new img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: absolute;
  inset: 0;
  z-index: 2;
}

.photo-label-text {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #408a5b;
  font-weight: 600;
  margin-top: 8px;
  cursor: pointer;
}

.photo-label-text:hover {
  text-decoration: underline;
}

/* Styled Checkbox Containers (Paso 4 & 7) */
.checkbox-option-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  border-radius: 8px;
  background-color: #fff;
  transition: all 0.2s ease;
  cursor: pointer;
}

.checkbox-option-box:hover {
  border-color: #408a5b;
  background-color: #f1f6f3;
}

.checkbox-option-box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #408a5b;
  cursor: pointer;
  margin: 0;
}

.checkbox-option-box label {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0 !important;
  cursor: pointer;
  width: 100%;
}

/* Tags (Seed Rubros) */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  animation: scaleUp 0.2s ease;
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.tag-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--error);
  font-size: 0.95rem;
  line-height: 1;
  font-weight: 800;
  display: flex;
  align-items: center;
}

.tag-remove:hover {
  opacity: 0.7;
}

/* Checkbox options grid */
.checkbox-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 10px 0;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.88rem;
}

.checkbox-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.checkbox-large {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.checkbox-large:hover {
  background-color: #f1f5f9;
}

.checkbox-large input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  margin-top: 2px;
}

.checkbox-large span {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Subforms (Agrícola / Pecuario cards) */
.subform-card {
  background-color: var(--primary-light);
  border: 1px dashed var(--primary);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.subform-card h3 {
  font-family: var(--font-header);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 15px;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid #e2e8f0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background-color: #f8fafc;
  color: var(--text-main);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid #e2e8f0;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.empty-row-placeholder {
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(25, 74, 43, 0.2), 0 2px 4px -1px rgba(25, 74, 43, 0.1);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid #78716c;
  color: #1c1917;
}

.btn-outline:hover {
  background-color: #f5f5f4;
}

.btn-danger {
  background-color: #fee2e2;
  color: var(--error);
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-danger:hover {
  background-color: var(--error);
  color: #fff;
}

/* Nav Actions */
.form-navigation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 30px;
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
}

#btnPrev {
  margin-right: auto;
}

.btn-submit {
  background-color: var(--secondary);
  color: #fff;
  padding: 10px 28px;
  box-shadow: var(--shadow-md);
}

.btn-submit:hover {
  background-color: var(--secondary-hover);
  transform: translateY(-1px);
}

/* Error states */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--error);
  background-color: #fffdfd;
}

.error-msg {
  color: var(--error);
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 4px;
  display: block;
}

/* Summary Box */
.summary-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.88rem;
}

.summary-section {
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 15px;
}

.summary-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.summary-section-title {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.summary-item {
  display: flex;
  flex-direction: column;
}

.summary-item-label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.summary-item-value {
  font-weight: 700;
  color: var(--text-main);
}

.summary-profile-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
  margin-bottom: 15px;
}

/* Jurada Box */
.jurada-container {
  margin-top: 25px;
  padding: 15px 0;
}

.jurada-text {
  line-height: 1.4;
  font-weight: 500 !important;
  color: #334155;
}

/* ==================== CORDAMI CARNET (cn2-card) STYLING ==================== */

.nav-aligned-row-carnet {
  margin-bottom: 20px;
  display: flex;
  justify-content: flex-start;
}

.btn-back-minimal {
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  transition: opacity 0.2s;
  padding: 5px 0;
}

.btn-back-minimal:hover {
  opacity: 0.8;
}

.carnet-view-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carnet-preview-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px;
  overflow-x: auto;
  background: #f1f5f9;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 660px;
  min-height: 420px;
}

.cn2-card, .cn2-card * {
  box-sizing: border-box;
}

.cn2-card {
  width: 600px;
  height: 360px;
  background: #ffffff;
  border: 2px solid #bbc1bc;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  position: relative;
  font-family: 'Arial', sans-serif;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.3s ease;
}

.cn2-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5px 15px;
  background: #ffffff;
  height: 65px;
  width: 100%;
}

.cn2-header-img-center {
  width: 100%;
  height: 100%;
  max-height: 55px;
  object-fit: contain;
}

.cn2-title-bar {
  background: #194a2b;
  color: #ffffff;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 8px 0;
  text-transform: uppercase;
}

.cn2-body {
  display: flex;
  padding: 12px 20px;
  align-items: center;
  flex: 1;
}

.cn2-photo-col {
  flex-shrink: 0;
}

.cn2-photo-frame {
  width: 105px;
  height: 135px;
  border: 2px solid #194a2b;
  border-radius: 8px;
  overflow: hidden;
  background: #e8e8e8;
}

.cn2-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cn2-data-col {
  width: 250px;
  padding-left: 15px;
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cn2-data-group {
  margin-bottom: 8px;
}

.cn2-field-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #000;
  margin: 0 0 2px 0;
}

.cn2-field-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  text-transform: uppercase;
  line-height: 1.2;
  word-break: break-word;
}

.cn2-cedula-line {
  margin: 6px 0 0 0;
  font-size: 0.90rem;
  white-space: nowrap;
}

.cn2-qr-line-separator {
  width: 2px;
  background: #194a2b;
  height: 120px;
  margin-right: 25px;
}

.cn2-qr-col {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

#cn-qr-container {
  width: 130px;
  height: 130px;
}

#cn-qr-container img {
  width: 100% !important;
  height: 100% !important;
}

.cn2-bottom-strip {
  background: #eaf3ea;
  display: flex;
  border-top: 1px solid #194a2b;
  border-bottom: 1px solid #194a2b;
  margin-top: 11px;
  height: 50px;
}

.cn2-strip-item {
  flex: 1;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid #194a2b;
  overflow: hidden;
}

.cn2-strip-label {
  font-size: 0.6rem;
  font-weight: 800;
  color: #194a2b;
  text-transform: uppercase;
  margin-bottom: 2px;
  white-space: nowrap;
}

.cn2-strip-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: #000;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cn2-footer-bar {
  background: #194a2b;
  color: #ffffff;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 2px;
  padding: 6px;
  text-transform: uppercase;
}

/* REVERSO STYLING */
.cn2-back-top {
  background: #194a2b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
}

.cn2-serial-box {
  background: #ffffff;
  border-radius: 5px;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cn2-serial-word {
  font-size: 0.9rem;
  font-weight: 800;
  color: #000;
}

.cn2-serial-num {
  font-size: 1.1rem;
  font-weight: 900;
  color: #c91a1a;
}

.cn2-back-institution {
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: right;
  max-width: 60%;
  line-height: 1.3;
}

.cn2-back-legal {
  padding: 12px 30px 8px;
  position: relative;
  z-index: 2;
}

.cn2-back-legal em {
  font-size: 0.82rem;
  color: #333;
  font-style: italic;
  line-height: 1.45;
  display: block;
}

.cn2-back-middle {
  flex: 1;
  position: relative;
  padding: 8px 30px 10px;
  display: flex;
  align-items: flex-start;
}

.cn2-dates-block {
  display: flex;
  gap: 30px;
  position: relative;
  z-index: 2;
}

.cn2-date-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cn2-date-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #000;
  line-height: 1.25;
  text-transform: uppercase;
}

.cn2-date-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #222;
}

.cn2-signature-block {
  position: absolute;
  bottom: 0;
  right: 20px;
  z-index: 1;
}

.cn2-signature-block img {
  width: 510px;
  max-width: 510px;
  display: block;
}

.cn2-footer-back {
  margin-top: auto;
}

/* Face toggle button styles */
.carnet-face-toggle {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  margin-top: 15px;
}

.face-toggle-btn {
  background-color: #fff;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.face-toggle-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.carnet-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

/* ==================== CUSTOM PREMIUM MODAL NOTIFICATION ==================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--card-background);
  border-radius: 16px;
  padding: 35px 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-overlay.show .modal-card {
  transform: scale(1);
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  line-height: 1;
}

.modal-title {
  font-family: var(--font-header);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}

.modal-message {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.5;
}

.modal-card .btn {
  width: 100%;
  padding: 12px 20px;
  font-size: 0.92rem;
  border-radius: 8px;
}

/* Scaling carnet on mobile */
@media (max-width: 768px) {
  .features-row {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .fields-grid,
  .fields-grid.cols-3,
  .fields-grid.cols-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
  
  .form-card {
    padding: 20px;
  }
  
  .app-title {
    font-size: 1.5rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: 2.2rem;
    letter-spacing: -1px;
  }
  
  .top-navbar {
    padding: 0 15px;
  }
  
  .nav-links {
    gap: 12px;
  }

  /* Carnet view responsive */
  #view-carnet > div:first-child h1 {
    font-size: 1.6rem !important;
  }

  #view-carnet > div:first-child p {
    font-size: 0.9rem !important;
  }

  .carnet-view-container {
    overflow-x: hidden;
  }

  .carnet-preview-wrapper {
    display: flex;
    justify-content: center;
    overflow: hidden;
    min-height: 230px;
    margin-bottom: -20px;
  }

  .cn2-card {
    transform: scale(0.58);
    transform-origin: top center;
    flex-shrink: 0;
  }

  /* Action buttons stacked on mobile */
  #view-carnet .carnet-actions,
  #view-carnet > .carnet-view-container > div:last-child {
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: 0 !important;
  }

  #view-carnet button#btn-download-front,
  #view-carnet button#btnBackToLanding {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  /* Even smaller — phones */
  .cn2-card {
    transform: scale(0.46);
    transform-origin: top center;
  }

  .carnet-preview-wrapper {
    min-height: 190px;
    margin-bottom: -50px;
  }

  #view-carnet > div:first-child {
    padding: 28px 16px 18px !important;
  }

  #view-carnet > div:first-child h1 {
    font-size: 1.3rem !important;
  }
}

/* Horizontal Activity Cards */
.activity-selector-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 25px;
  width: 100%;
}

.activity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 8px;
  background-color: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  user-select: none;
}

.activity-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: #408a5b;
}

.activity-card.selected {
  background-color: #f1f6f3;
  border-color: #408a5b;
  box-shadow: 0 0 0 1px #408a5b;
}

.activity-card-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background-color: #f8fafc;
  transition: all 0.2s ease;
}

.activity-card-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

#act-siembra .activity-card-icon-wrapper {
  background-color: #e8f5e9; /* Pastel green */
}
#act-siembra.selected .activity-card-icon-wrapper {
  background-color: #c8e6c9;
}

#act-ganaderia .activity-card-icon-wrapper {
  background-color: #fbe9e7; /* Pastel red/terracotta */
}
#act-ganaderia.selected .activity-card-icon-wrapper {
  background-color: #ffccbc;
}

#act-apicultura .activity-card-icon-wrapper {
  background-color: #fff8e1; /* Pastel amber/yellow */
}
#act-apicultura.selected .activity-card-icon-wrapper {
  background-color: #ffe082;
}

#act-pesca .activity-card-icon-wrapper {
  background-color: #e3f2fd; /* Pastel blue */
}
#act-pesca.selected .activity-card-icon-wrapper {
  background-color: #bbdefb;
}

.activity-card-label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.activity-card-checkbox {
  display: none;
}

@media (max-width: 600px) {
  .activity-selector-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* --- MULTI-ACTIVITY SELECTOR STYLES --- */
.btn-add-act-plus {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background-color: #28a745;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}
.btn-add-act-plus:hover {
  background-color: #1c5e31;
}
.added-activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f4fbf6;
  border: 1px solid #c8e6c9;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: bold;
  color: #1e4620;
}
.btn-delete-activity-item {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}
.btn-delete-activity-item:hover {
  background: #ffcdd2;
}

/* --- STEP 7 INFRASTRUCTURE TOGGLE & MANO DE OBRA CARDS --- */
.infra-container-box {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  background: #ffffff;
  margin-bottom: 25px;
}

.infra-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.mano-obra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.infra-toggle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 15px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.infra-toggle-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}
.infra-toggle-label {
  font-weight: 600;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.2;
}

/* Sliding Toggle Switch Style */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
input:checked + .slider {
  background-color: #28a745;
}
input:checked + .slider:before {
  transform: translateX(20px);
}

.mano-obra-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
  transition: transform 0.2s, box-shadow 0.2s;
}
.mano-obra-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04);
}

/* ==================== AUTH MODAL ==================== */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 30, 0.65);
  backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInOverlay 0.2s ease;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-modal-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 32px 32px 28px;
  width: 100%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  animation: slideUpCard 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpCard {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.auth-modal-close:hover { color: #1e293b; }

.auth-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 6px;
}

.auth-modal-subtitle {
  font-size: 0.9rem;
  color: #2d6a2d;
  margin: 0 0 22px;
  line-height: 1.5;
}

/* Tab row */
.auth-tab-row {
  display: flex;
  border: 1.5px solid #1a5c2a;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 11px 10px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  background: #f1f5f1;
  color: #64748b;
  transition: background 0.2s, color 0.2s;
}

.auth-tab.active {
  background: #ffffff;
  color: #1a5c2a;
  border: none;
  outline: none;
}

.auth-tab:first-child { border-right: 1px solid #1a5c2a; }

/* Fields */
.auth-field-group {
  margin-bottom: 18px;
}

.auth-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.auth-input:focus {
  border-color: #1a5c2a;
  box-shadow: 0 0 0 3px rgba(26, 92, 42, 0.1);
  background: #ffffff;
}

/* Submit button */
.auth-submit-btn {
  width: 100%;
  padding: 14px;
  background: #1a5c2a;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.2s, transform 0.1s;
}
.auth-submit-btn:hover {
  background: #155221;
  transform: translateY(-1px);
}
.auth-submit-btn:active {
  transform: translateY(0);
}

/* Password wrapper with eye toggle */
.auth-pwd-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-pwd-wrapper .auth-input {
  padding-right: 44px;
  width: 100%;
}

.auth-pwd-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.auth-pwd-toggle:hover { color: #1a5c2a; }

/* ==================== RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS ==================== */

/* Tablet & Medium Screens (< 840px) */
@media (max-width: 840px) {
  .top-navbar {
    padding: 10px 20px;
    height: auto;
    min-height: 60px;
  }

  .nav-brand {
    gap: 8px;
  }

  .brand-logo {
    height: 2.3rem;
    width: 2.3rem;
  }

  .brand-name {
    font-size: 0.95rem;
  }

  .brand-sub {
    font-size: 0.58rem;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    padding: 7px 14px;
    font-size: 0.8rem;
  }

  .hero-title {
    font-size: 2.5rem;
    letter-spacing: -1px;
  }

  .hero-desc {
    font-size: 1.05rem;
  }
}

/* Mobile Screens (< 640px) */
@media (max-width: 640px) {
  .top-navbar {
    padding: 0 10px;
    height: 56px;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    gap: 6px;
  }

  .nav-brand {
    gap: 6px;
    flex-shrink: 0;
  }

  .brand-logo {
    height: 2.6rem;
    width: 2.6rem;
  }

  .brand-name {
    font-size: 0.85rem;
    letter-spacing: 0.2px;
  }

  .brand-sub {
    font-size: 0.52rem;
  }

  .nav-links {
    gap: 4px;
    flex-wrap: nowrap !important;
    flex-shrink: 0;
    overflow: visible;
  }

  .nav-links a {
    padding: 4px 8px;
    font-size: 0.68rem;
    height: 25px;
    white-space: nowrap;
    border-radius: 14px;
    gap: 3px;
  }

  .app-container {
    margin: 16px auto;
    padding: 0 10px;
  }

  /* Landing Hero Mobile */
  .landing-hero {
    padding: 20px 6px;
  }

  .badge-status {
    padding: 4px 12px;
    font-size: 0.72rem;
    margin-bottom: 16px;
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
  }

  .hero-desc {
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 28px;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions .btn-large {
    width: 100%;
    padding: 12px 18px;
    font-size: 0.9rem;
  }

  /* Features Grid Mobile */
  .features-row {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 10px;
  }

  .feature-item {
    padding: 16px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  }

  .feature-icon-box {
    margin-bottom: 14px;
  }

  .section-divider {
    margin: 30px 0;
  }

  /* Form Card & Fields Mobile */
  .form-card {
    padding: 18px 12px;
    border-radius: 12px;
  }

  .app-title {
    font-size: 1.4rem;
  }

  .app-subtitle {
    font-size: 0.85rem;
  }

  .step-section-title {
    font-size: 1rem;
    grid-column: span 1 !important;
  }

  .fields-grid,
  .fields-grid.cols-3,
  .fields-grid.cols-4 {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .form-group.full-width {
    grid-column: span 1 !important;
  }

  .input-addon-group {
    flex-direction: row;
  }

  .input-addon-select {
    width: 65px;
  }

  .checkbox-options-grid {
    grid-template-columns: 1fr;
  }

  .infra-container-box {
    padding: 12px 8px;
    border-radius: 10px;
    margin-bottom: 16px;
  }

  .infra-toggle-grid,
  .mano-obra-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .infra-toggle-card {
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .infra-toggle-label {
    font-size: 0.85rem;
  }

  /* Form Navigation Actions Mobile */
  .form-navigation-actions {
    flex-direction: row;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
  }

  .form-navigation-actions .btn {
    padding: 10px 14px;
    font-size: 0.82rem;
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  #btnPrev {
    margin-right: 0;
  }

  /* Carnet Card Mobile Responsive Scaler */
  .carnet-preview-wrapper {
    padding: 12px 6px;
    min-height: auto;
    overflow-x: auto;
  }

  /* Summary Grid Mobile */
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .summary-box {
    padding: 14px 10px;
  }

  /* Auth Modal & Custom Modal Mobile */
  .auth-modal-card,
  .modal-card {
    padding: 22px 16px;
    border-radius: 14px;
    width: 95%;
  }

  .auth-modal-title {
    font-size: 1.15rem;
  }

  .auth-modal-subtitle {
    font-size: 0.82rem;
    margin-bottom: 16px;
  }

  .auth-tab {
    font-size: 0.85rem;
    padding: 9px 4px;
  }

  .auth-input,
  .auth-submit-btn {
    font-size: 0.9rem;
    padding: 10px 12px;
  }
}

/* Extra Small Screens (< 380px) */
@media (max-width: 380px) {
  .top-navbar {
    padding: 6px 8px;
  }

  .brand-text {
    display: none;
  }

  .nav-links a {
    padding: 5px 9px;
    font-size: 0.72rem;
  }

  .hero-title {
    font-size: 1.55rem;
  }
}
