/* =====================================================================
   Application Form Changes CR (Aug 2026) - KYC Details block

   The CR adds 5 dropdowns plus a name field to the Personal Details
   screen, for the depositor and both joint depositors. Stacked in a
   single column that is a very long scroll, so on desktop the whole
   form becomes a two-column grid.

   section.add-email is capped at 389px by the theme, while the parent
   col-md-7 is roughly twice that - the second column therefore uses
   space that already sits empty inside our own column. Nothing that
   existed before this CR changes width.

   Below 992px everything collapses to one column and the screen
   behaves exactly as it did before.
   ===================================================================== */

/* ---------------------------------------------------------------------
   Field styling

   main.scss in this module is not referenced by any JSP - the field
   styling actually comes from the portal theme, and it does not reach
   the selects rendered by applicationFormCRFields.jsp. These rules
   restate that look so the new controls match the fields above them.
   Scoped to the CR blocks only, so nothing else on the journey moves.
   --------------------------------------------------------------------- */
.kyc-details-section select,
.kyc-details-section input.input,
.dep-occ-type select,
.dep-occ-type input.input{
   width:100%;
   height:46px;
   padding:0 38px 0 14px;
   border:1px solid var(--Color000000A020, #d5cec4);
   border-radius:5px;
   background-color:var(--SecondaryWhite, #ffffff);
   font-size:15px;
   color:var(--PrimaryBlack, #231f20);
   box-sizing:border-box;
   -webkit-appearance:none;
   -moz-appearance:none;
   appearance:none;
}

.kyc-details-section input.input,
.dep-occ-type input.input{
   padding-right:14px;
}

/* Chevron, drawn inline so there is no extra asset to deploy. */
.kyc-details-section select,
.dep-occ-type select{
   background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23231f20' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
   background-repeat:no-repeat;
   background-position:right 14px center;
}

.kyc-details-section select:focus,
.kyc-details-section input.input:focus,
.dep-occ-type select:focus,
.dep-occ-type input.input:focus{
   outline:none;
   border-color:var(--TertiaryBlue, #1b2a5b);
}

/* ---------------------------------------------------------------------
   Spacing

   The theme puts margin-top:12px on labels inside add-email and the
   markup carries mt-4 as well. Stacked in one column that reads fine;
   in a two-column grid it opens a ~56px gap between rows. Neutralised
   here and replaced with a single row-gap.
   --------------------------------------------------------------------- */
.kyc-details-section{
   margin-top:20px;
}

/* Quiet divider label rather than a second heading. Styled as a bold
   heading with a full-width rule it competed with the page title above
   it - similar weight, heavier treatment - so the screen read as two
   titles instead of a title with a section beneath it. */
.kyc-details-heading{
   font-size:12px;
   font-weight:500;
   letter-spacing:0.09em;
   text-transform:uppercase;
   color:var(--PrimaryGrey, #8a7f72);
   margin:0;
   padding-bottom:0;
   border-bottom:none;
}

/* !important is required here for the same reason as the grid rules below:
   the markup carries Bootstrap's mt-4, which is itself !important. The KYC
   fields sit inside .kyc-details-section, and because that section uses
   display:contents they are not direct children of section.add-email - so
   the direct-child reset further down never reaches them, and their rows
   end up ~24px further apart than the two rows above. Scoped to the CR
   blocks only. */
.kyc-details-section .input-field-fd,
.dep-occ-type{
   margin-top:0 !important;
   margin-bottom:0 !important;
}

.kyc-details-section label,
.dep-occ-type label{
   margin-top:0 !important;
   margin-bottom:6px !important;
   display:block;
}

/* The Occupation Details wrapper sits outside .kyc-details-section, so it
   still picked up the theme's margin-bottom:12px on labels while the
   sub-dropdown opposite it had 6px - leaving the two selects ~6px out of
   line. Matched here. */
section.add-email > .input-field-fd > label:first-child,
section.coDepositorO-differently-abled-section > .input-field-fd > label:first-child,
section.coDepositorT-differently-abled-section > .input-field-fd > label:first-child{
   margin-bottom:6px !important;
}

/* Reserve the error line so showing a message never shunts the
   neighbouring column up or down. */
.kyc-details-section .error,
.dep-occ-type .error{
   display:block;
   min-height:17px;
   line-height:17px;
   font-size:12px;
}

/* The conditional "Please specify" control sits under its own dropdown. */
.kyc-details-section div[id$="OtherDiv"],
.dep-occ-type div[id$="OtherDiv"]{
   margin-top:6px;
}

/* ---------------------------------------------------------------------
   UDID Validity - Date / Month / Year row

   .select-date-regiser is a flex row of three selects. The theme only
   ever sized them through span.select2-selection, and select2 is not
   loaded on this journey, so the three native selects keep their
   natural width (~420px total) and overflow the column.

   Scoped to the UDID rows by id so the nominee and guardian date rows
   elsewhere on the journey are untouched.
   --------------------------------------------------------------------- */
div[id$="select-date-UDID"]{
   display:flex;
   gap:8px;
   width:100%;
   box-sizing:border-box;
}

div[id$="select-date-UDID"] > div{
   flex:1 1 0;
   min-width:0;
}

div[id$="select-date-UDID"] select{
   width:100%;
   height:46px;
   /* Three controls sharing a 389px column leaves ~120px each. "Select Month"
      is the longest placeholder, so the text is stepped down a little and the
      chevron gutter kept clear of it. */
   padding:0 24px 0 9px;
   font-size:13px;
   border:1px solid var(--Color000000A020, #d5cec4);
   border-radius:5px;
   background-color:var(--SecondaryWhite, #ffffff);
   background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23231f20' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
   background-repeat:no-repeat;
   background-position:right 8px center;
   color:var(--PrimaryBlack, #231f20);
   box-sizing:border-box;
   -webkit-appearance:none;
   -moz-appearance:none;
   appearance:none;
   text-overflow:ellipsis;
}

/* The month control needs the most room of the three. */
div[id$="select-date-UDID"] > div:nth-child(2){
   flex:1.15 1 0;
}

/* The impairment panel's own fields inherit the same treatment so the
   whole YES branch matches the fields around it. */
.inner-depositor-differently-abled-section select,
.inner-depositor-differently-abled-section input.input,
.inner-coDepositorO-differently-abled-section select,
.inner-coDepositorO-differently-abled-section input.input,
.inner-coDepositorT-differently-abled-section select,
.inner-coDepositorT-differently-abled-section input.input{
   width:100%;
   box-sizing:border-box;
}

/* ---------------------------------------------------------------------
   PEP Declaration - Review & Confirm screen
   --------------------------------------------------------------------- */
.pep-declaration-review{
   margin:24px 0 18px 0;
   position:relative;
}

.pep-declaration-heading{
   font-size:16px;
   font-weight:600;
   margin:0 0 6px 0;
}

.pep-declaration-heading span{
   color:var(--PrimaryRed, #d0021b);
   font-size:20px;
   line-height:0;
}

.pep-declaration-text{
   margin:0 0 10px 0;
}

.pep-declaration-options{
   display:flex;
   align-items:center;
   gap:32px;
}

.pep-declaration-options span{
   display:flex;
   align-items:center;
   gap:8px;
}

.pep-declaration-options label{
   margin:0 !important;
   cursor:pointer;
}

.pep-declaration-review > .error{
   display:block;
   min-height:17px;
   line-height:17px;
   font-size:12px;
   margin-top:6px;
}

/* ---------------------------------------------------------------------
   Two-column layout
   --------------------------------------------------------------------- */
@media only screen and (min-width: 992px) {

  /* The whole Personal Details form becomes the grid, not just the new
     block - otherwise the fields above keep wasting the right half and
     the page is still a long scroll.

     display:contents lets the KYC section's children join the same grid,
     so the layout flows continuously:

        row 1   Email ID               | Differently Abled Status
        row 2   Occupation (+ cascade) | conditional sub-field
        row 3   KYC Details heading   (spans both)
        row 4   Source of Funds        | Source of Wealth
        row 5   Educational Qual.      | Gross Annual Income
        row 6   Marital Status         | Father/Mother/Spouse
        row 7   Next                  (spans both)  */
  section.add-email{
     display:grid;
     grid-template-columns:repeat(2, minmax(0, 389px));
     column-gap:34px;
     row-gap:20px;
     align-items:start;
     max-width:812px;
  }

  /* Heading sits on its own row so the two columns start level. */
  section.add-email > h2{
     grid-column:1 / -1;
     margin:0;
     padding-bottom:4px;
  }

  /* !important is required: the markup carries Bootstrap's mt-4, which is
     itself declared !important, so a plain margin-top:0 loses to it and the
     left column ends up ~24px lower than the right. */
  section.add-email > .input-field-fd,
  section.add-email > .dep-occ-type,
  section.add-email > section.depositor-differently-abled-section{
     margin-top:0 !important;
     align-self:start;
  }
  section.add-email > .input-field-fd > label:first-child,
  section.add-email > .dep-occ-type > label:first-child,
  section.add-email > section.depositor-differently-abled-section > label:first-child{
     margin-top:0 !important;
  }

  section.add-email > .next-global{
     grid-column:1 / -1;
     margin-top:10px;
  }
  section.add-email > .kyc-details-section{
     display:contents;
  }
  .kyc-details-heading{
     grid-column:1 / -1;
     /* Sits between the last row above and the first KYC row, which already
        carry row-gap, so this only adds the extra separation the label needs
        to read as a section break. */
     margin-top:8px;
     margin-bottom:-4px;
  }

  /* The Differently Abled panel is one field when NO and seven when YES.
     Its labels and inputs are flat siblings, not wrapped per field, so it
     cannot itself become a grid without splitting a label from its input.
     Instead the whole section spans both columns when expanded. */
  section.add-email > section.depositor-differently-abled-section:has(.inner-depositor-differently-abled-section[style*="block"]){
     grid-column:1 / -1;
     max-width:812px;
  }

  /* Joint depositor 1 and 2 screens. */
  section.coDepositorO-differently-abled-section,
  section.coDepositorT-differently-abled-section{
     max-width:812px;
  }
  section.coDepositorO-differently-abled-section > .input-field-fd,
  section.coDepositorO-differently-abled-section > .dep-occ-type,
  section.coDepositorT-differently-abled-section > .input-field-fd,
  section.coDepositorT-differently-abled-section > .dep-occ-type{
     margin-top:0 !important;
     align-self:start;
  }
  section.coDepositorO-differently-abled-section > .input-field-fd > label:first-child,
  section.coDepositorO-differently-abled-section > .dep-occ-type > label:first-child,
  section.coDepositorT-differently-abled-section > .input-field-fd > label:first-child,
  section.coDepositorT-differently-abled-section > .dep-occ-type > label:first-child{
     margin-top:0 !important;
  }
  section.coDepositorO-differently-abled-section > .kyc-details-section,
  section.coDepositorT-differently-abled-section > .kyc-details-section{
     display:grid;
     grid-template-columns:repeat(2, minmax(0, 389px));
     column-gap:34px;
     row-gap:20px;
     align-items:start;
     max-width:812px;
  }
  section.coDepositorO-differently-abled-section > .kyc-details-section > .kyc-details-heading,
  section.coDepositorT-differently-abled-section > .kyc-details-section > .kyc-details-heading{
     grid-column:1 / -1;
  }
}

/* =====================================================================
   Application Form Changes CR (Sept 2026) - Review & Confirm screen,
   section open/close.

   Not Bootstrap's .collapse/.show classes on purpose - this app's
   Bootstrap JS/CSS is upgraded independently per environment for VAPT
   fixes, so this screen owns its own open/close state instead of
   depending on whichever Bootstrap version happens to be loaded.
   Click handling lives in js/journeyOnLoadAndResumeHandler.jsp.
   ===================================================================== */
.cr-review-panel {
   display: none;
}
.cr-review-panel.cr-panel-open {
   display: block;
}
