.gi-crib-form, .gi-crib-form * { box-sizing: border-box; }

      .gi-crib-form {
          display: flex;
          flex-direction: column;
          gap: 24px;
          width: 100%;
          max-width: 544px;
          margin: 0 auto;
          font-family: 'Montserrat', sans-serif;
      }

      .gi-crib-form__top { display: flex; flex-direction: column; gap: 16px; }

      .gi-crib-form__header {
          margin: 0;
          font-family: 'Montserrat', sans-serif;
          font-size: 18px;
          line-height: 21px;
          font-weight: 900;
          color: #000000;
      }

      /* Header size: data-header-size = "small" (default) | "medium" | "large" */
      .gi-crib-form[data-header-size="medium"] .gi-crib-form__header { font-size: 24px; line-height: 28px; }
      .gi-crib-form[data-header-size="large"]  .gi-crib-form__header { font-size: 32px; line-height: 38px; }

      /* Header alignment: data-header-align = "left" (default) | "center" | "right" */
      .gi-crib-form[data-header-align="center"] .gi-crib-form__header { text-align: center; }
      .gi-crib-form[data-header-align="right"]  .gi-crib-form__header { text-align: right; }

      .gi-crib-form__fields { display: flex; flex-direction: column; gap: 12px; }

      /* Shared field look (email + date) */
      .gi-crib-form__input {
          display: block;
          width: 100%;
          height: 50px;
          margin: 0;
          padding: 10px 15px;
          border: 1px solid transparent;
          border-radius: 8px;
          background-color: #f4f4f4;
          font-family: 'Montserrat', sans-serif;
          font-size: 16px;
          font-weight: 400;
          letter-spacing: -0.25px;
          color: #000000;
          outline: none;
          -webkit-appearance: none;
          appearance: none;
          transition: background-color 0.15s, border-color 0.15s;
      }
      .gi-crib-form__input::placeholder { color: #000000; opacity: 0.5; }
      .gi-crib-form__input:focus { background-color: #f9f9f9; border-color: #dddddd; }

      /* ---- Date field ---- */
      .gi-crib-form__date { position: relative; width: 100%; }

      .gi-crib-form__date input[type="date"] {
          position: relative;
          cursor: pointer;
          color: transparent;           /* hide the native mm/dd/yyyy text */
          padding-right: 45px;
          /* Calendar icon drawn by us so it is always visible */
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='2.5'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3C/svg%3E");
          background-repeat: no-repeat;
          background-position: right 12px center;
          background-size: 20px 20px;
      }
      .gi-crib-form__date input[type="date"]:hover { background-color: #efefef; }

      /* Hide the editable date segments completely */
      .gi-crib-form__date input[type="date"]::-webkit-datetime-edit,
      .gi-crib-form__date input[type="date"]::-webkit-datetime-edit-fields-wrapper,
      .gi-crib-form__date input[type="date"]::-webkit-date-and-time-value {
          opacity: 0;
      }

      /* KEY FIX: stretch the browser's own (invisible) calendar button across the
         WHOLE field, so a click anywhere opens the native date picker.
         Works inside iframes too, no showPicker() needed. */
      .gi-crib-form__date input[type="date"]::-webkit-calendar-picker-indicator {
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          width: 100%;
          height: 100%;
          margin: 0;
          padding: 0;
          opacity: 0;
          cursor: pointer;
          background: transparent;
      }

      /* Text shown inside the field: the label, or the chosen date */
      .gi-crib-form__date-text {
          position: absolute;
          left: 16px;
          right: 45px;
          top: 50%;
          transform: translateY(-50%);
          font-family: 'Montserrat', sans-serif;
          font-size: 16px;
          letter-spacing: -0.25px;
          color: #000000;
          opacity: 0.5;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          pointer-events: none;         /* clicks pass through to the input */
      }
      .gi-crib-form__date-text.is-filled { opacity: 1; }

      .gi-crib-form__actions { display: flex; flex-direction: column; gap: 10px; }

      /* Button alignment on desktop: set data-button-align on the form wrapper
         to "left", "center" or "right". Mobile is always full width. */
      .gi-crib-form[data-button-align="left"]   .gi-crib-form__actions { align-items: flex-start; }
      .gi-crib-form[data-button-align="center"] .gi-crib-form__actions { align-items: center; text-align: center; }
      .gi-crib-form[data-button-align="right"]  .gi-crib-form__actions { align-items: flex-end; text-align: right; }

      .gi-crib-form__button {
          width: 100%;
          max-width: 305px;
          height: 44px;
          background: #FACD06;
          color: #000000;
          border: none;
          border-radius: 4px 13px 4px 13px;
          font-family: 'Roboto Mono', monospace;
          font-size: 14px;
          font-weight: 500;
          letter-spacing: 0.75px;
          text-transform: uppercase;
          cursor: pointer;
          transition: background 0.15s ease;
      }
      .gi-crib-form__button:hover { background: #E8BC00; }

      .gi-crib-form__error {
          display: none;
          margin: 0;
          font-size: 13px;
          color: #c0392b;
      }
      .gi-crib-form__error.is-visible { display: block; }

      .gi-crib-form__disclaimer {
          margin: 0;
          font-family: 'Montserrat', sans-serif;
          font-size: 12px;
          line-height: 16px;
          font-weight: 500;
          color: #5a5a5a;
      }
      /* Disclaimer spans the full width; its alignment is set by data-disclaimer-align */
      .gi-crib-form .gi-crib-form__actions .gi-crib-form__disclaimer {
          align-self: stretch;
          text-align: left;
      }
      /* Disclaimer alignment: data-disclaimer-align = "left" (default) | "center" | "right" */
      .gi-crib-form[data-disclaimer-align="center"] .gi-crib-form__actions .gi-crib-form__disclaimer { text-align: center; }
      .gi-crib-form[data-disclaimer-align="right"]  .gi-crib-form__actions .gi-crib-form__disclaimer { text-align: right; }

      /* ---- Success state (shown after a valid submit) ---- */
      .gi-crib-form [hidden] { display: none !important; }

      .gi-crib-form__success {
          display: flex;
          flex-direction: column;
          align-items: flex-start;
          gap: 12px;
          outline: none;
      }
      .gi-crib-form__success-icon { display: block; width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; }
      .gi-crib-form__success-title {
          margin: 0;
          font-family: 'Montserrat', sans-serif;
          font-weight: 600;
          font-size: 18px;
          line-height: 1.15;
          color: #000000;
      }
      /* Success alignment: set data-success-align to "left", "center" or "right" */
      .gi-crib-form[data-success-align="center"] .gi-crib-form__success { align-items: center; text-align: center; }
      .gi-crib-form[data-success-align="right"]  .gi-crib-form__success { align-items: flex-end; text-align: right; }

      @media (max-width: 640px) {
          .gi-crib-form { gap: 20px; }
          .gi-crib-form__button { max-width: none; }
          .gi-crib-form .gi-crib-form__actions { align-items: stretch; text-align: left; }
          /* Bigger header sizes scale down on phones */
          .gi-crib-form[data-header-size="medium"] .gi-crib-form__header { font-size: 20px; line-height: 24px; }
          .gi-crib-form[data-header-size="large"]  .gi-crib-form__header { font-size: 24px; line-height: 28px; }
          /* Success message is always centered on mobile */
          .gi-crib-form[data-success-align] .gi-crib-form__success { align-items: center; text-align: center; }
      }