/* Layout */
.odoo-crm-form {
  width: 100%;
  max-width: 100%;
}
.odoo-crm-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}
.odoo-crm-field {
  box-sizing: border-box;
  grid-column: span var(--span, 12);
}

/* Title + info blocks */
.odoo-crm-header {
    margin-bottom: 14px;
}

.odoo-crm-title {
    margin: 0;
    font-family: "Poppins", sans-serif;
    font-size: 17px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: .1px;
}

.odoo-crm-before-checks {
    font-size: 12px;
    line-height: 17px;
    color: #999;
    margin-top: 9px;
    margin-bottom: 15px;
    padding-inline: 15px;
    text-align: center;
}

/* Floating label control */
.odoo-crm-control {
    position: relative;
}

.odoo-crm-control input[type="text"],
.odoo-crm-control input[type="email"],
.odoo-crm-control input[type="tel"],
.odoo-crm-control textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 20px 12px 6px;
  border: 0;
  border-radius: 12px;
  outline: none;
  font-size: 16px;
  line-height: 1.3;
  background: #fff;
  min-height: 54px;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.0779552);
}

.odoo-crm-control input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 12px;
  border: 0;
  border-radius: 12px;
  outline: none;
  font-size: 16px;
  line-height: 1.3;
  background: #fff;
  min-height: 54px;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.0779552);
}

.odoo-crm-control textarea {
  min-height: 110px;
  resize: vertical;
}

.odoo-crm-control label {
  position: absolute;
  left: 12px;
  top: 21px;
  font-size: 14px;
  line-height: 1;
  opacity: 0.65;
  pointer-events: none;
  transform-origin: left top;
  color: #222;
  transition: transform 140ms ease, top 140ms ease, opacity 140ms ease;
}

.odoo-crm-control input:focus + label,
.odoo-crm-control textarea:focus + label,
.odoo-crm-control input:not(:placeholder-shown) + label,
.odoo-crm-control textarea:not(:placeholder-shown) + label {
  top: 8px;
  transform: scale(0.82);
  opacity: 0.75;
}

.odoo-crm-control input:focus,
.odoo-crm-control textarea:focus {
  border-color: rgba(0,0,0,0.45);
}

/* File input (classic) */
.odoo-crm-filelabel {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  opacity: 0.85;
  position:absolute;
  left:-10000px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.odoo-crm-field input[type="file"] {
    width: 100%;
}

/* Checkboxes */
.odoo-crm-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.odoo-crm-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.35;
}
.odoo-crm-check input {
    margin-top: 2px;
}
.odoo-crm-check a {
    text-decoration: underline;
}

/* Button */
.odoo-crm-btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.2);
  background: #111;
  color: #fff;
  cursor: pointer;
  min-height: 54px;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
}
.odoo-crm-btn:hover {
    opacity: 0.92;
}

/* Notes */
.odoo-crm-note {
  padding: 10px 12px;
  border-radius: 10px;
  margin: 12px 0;
}
.odoo-crm-note.success {
    background: #e9f7ef;
    border: 1px solid #b8e2c7;
}
.odoo-crm-note.error {
    background: #fdecea;
    border: 1px solid #f5c2c0;
}

.odoo-crm-field > input[type="file"] {
  box-sizing: border-box;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  outline: none;
  font-size: 16px;
  line-height: 1.3;
  background: #fff;
  min-height: 44px;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.0779552);
}

/* File control wrapper */
.odoo-crm-file {
  position: relative;
}

/* Hide the real file input (but keep it accessible) */
.odoo-crm-fileinput {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Your fake button */
.odoo-crm-filebtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  width: 100%;

  background: #ECE7E4;
  color: #111;
  font-size: 14px;
  font-weight: 600;

  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.0779552);
}

.odoo-crm-filebtn:hover {
  background: #D6CEC5;
}

.odoo-crm-filebtn:focus {
  outline: 2px solid rgba(0,0,0,0.25);
  outline-offset: 2px;
}

/* “No files chosen” text */
.odoo-crm-filemeta {
  box-sizing: border-box;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  outline: none;
  font-size: 16px;
  line-height: 1.3;
  background: #fff;
  min-height: 44px;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.0779552);
}

.odoo-crm-filehint {
  display: block;
  font-size: 13px;
  color: #666;
}

/* Your existing list container */
.odoo-crm-fileitem {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.odoo-crm-filelist {
  display: grid;
  border-left: 2px solid #D6CEC5;
  padding-left: 16px;
}

.odoo-crm-fileitem {
  margin: 0; /* default: no margin */
}

/* if there are 2+ items => all except last get margin-bottom */
.odoo-crm-fileitem:not(:last-child) {
  margin-bottom: 21px;
}

.odoo-crm-fileremove {
  position: absolute;
  right: 6px;
  border-radius: 6px;
  border: none;
  min-height: 36px;
  background: #ECE7E4;
  padding: 0 10px;
}

.odoo-crm-fileremove:hover {
  background: #D6CEC5;
}

/* Checkbox row */
.odoo-crm-check {
  gap: 12px;
  align-items: start;
  font-size: 14px;
  line-height: 1.35;
}

/* Hide native checkbox */
.odoo-crm-check input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* We draw the box on the span */
.odoo-crm-check span {
  position: relative;
  display: block;
  padding-left: 34px;
}

/* Box */
.odoo-crm-check span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(18, 25, 97, 0.0779552);
  border: 1px solid rgba(0,0,0,0.12);
}

/* Check mark */
.odoo-crm-check span::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  width: 8px;
  height: 4px;
  border-left: 2px solid #111;
  border-bottom: 2px solid #111;
  transform: rotate(-45deg);
  opacity: 0;
}

/* Checked state */
.odoo-crm-check input[type="checkbox"]:checked + span::after {
  opacity: 1;
}

/* Focus ring */
.odoo-crm-check input[type="checkbox"]:focus + span::before {
  outline: 2px solid rgba(0,0,0,0.25);
  outline-offset: -2px;
}

/* Mobile */
@media (max-width: 640px) {
  .odoo-crm-field {
    grid-column: span 12 !important;
  }
  .odoo-crm-form {
    max-width: 100%;
  }
  .odoo-crm-filemeta {
    display: block;
  }
  .odoo-crm-filehint {
    margin-bottom: 16px;
  }
  .odoo-crm-filelist {
    border-left: none;
    padding-left: 0;
  }
}
