/* FATCA Declaration Checkbox Inline */
.fatca-declaration label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 1rem;
}

/* Reset some default styles */
html, body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f5f6fa;
}

/* Document Upload Section Styles */
.document-upload-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
}

.document-upload-column {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.document-requirements-column {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.document-requirements-column h4 {
  margin: 0 0 1rem;
  color: #2c3e50;
  font-size: 1.2rem;
}

.doc-requirement-section {
  margin-bottom: 1.5rem;
}

.doc-requirement-section h5 {
  color: #34495e;
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.doc-requirement-section ul {
  margin: 0;
  padding-left: 1.5rem;
}

.doc-requirement-section ul li {
  margin-bottom: 0.5rem;
  color: #444;
  font-size: 0.95rem;
}

.doc-requirement-section ul ul {
  margin-top: 0.5rem;
}

.document-requirements-column .notes {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fff4e5;
  border-radius: 6px;
  border-left: 4px solid #ffa726;
}

.document-requirements-column .notes ul {
  margin-top: 0.5rem;
}

.document-requirements-column .notes li {
  font-size: 0.9rem;
  color: #555;
}

/* Responsive Design for Document Upload */
@media (max-width: 768px) {
  .document-upload-container {
    grid-template-columns: 1fr;
  }
  
  .document-requirements-column {
    margin-top: 1rem;
  }
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 30px 20px;
  border: 1px solid #888;
  width: 90%;
  max-width: 400px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: relative;
}

.modal-content p {
  text-align: center;
}

.modal-logo {
  width: 120px;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #fff;
}

.modal-contact {
  margin-top: 18px;
  font-size: 0.95rem;
  color: #222;
  line-height: 1.5;
}

.modal-contact a {
  color: #1c3faa;
  text-decoration: none;
}

.modal-contact a:hover {
  text-decoration: underline;
}

.modal-redirect-msg {
  margin-top: 18px;
  color: #888;
  font-size: 0.95rem;
}

/* Processing modal (used during form submission) */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  pointer-events: auto;
}

.processing-box {
  background: #fff;
  padding: 18px 22px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.processing-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #ddd;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: processing-spin 1s linear infinite;
}

.processing-message {
  font-size: 14px;
  color: #222;
}

@keyframes processing-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Document item small layout tweaks (used by addDocumentField) */
.document-item { margin-top: 8px; }
.document-item input[type="file"] { margin-left: 6px; }
.document-item .remove-btn { margin-left: 8px; }

/* Signature preview image (inserted by JS) */
.signature-preview-img { max-width: 100px; margin-top: 5px; display: block; }

/* Modal visibility helper: add to show modal instead of inline style */
.modal.modal-visible { display: block; }

/* Body no-scroll when modal open */
.no-scroll { overflow: hidden !important; }

/* Generic hidden helper */
.hidden { display: none !important; }

/* FATCA small helpers used by JS-rendered HTML */
.fatca-declare-label { display: block; margin-top: 8px; }
.fatca-country-row { margin-top: 12px; }

/* Submitting state for buttons */
.is-submitting {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  right: 20px;
  top: 10px;
}

.close:hover,
.close:focus {
  color: #1c3faa;
  text-decoration: none;
  cursor: pointer;
}

header {
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

header div{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1000px;
}


.form-title {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: left;
  margin-top: 0;
  color: #ED1651;
  display: flex;
  align-items: center;
}

header .form-title {
  flex: 1 1 0;
  text-align: left;
  word-break: break-word;
}

header img {
  height: 100px;
  width: auto;
  margin-left: 2rem;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  header {
    gap: 1rem;
  }
  header .form-title {
    font-size: 1.1rem;
    line-height: 1.2;
    max-width: 70vw;
    flex-direction: column;
    align-items: flex-start;
    text-align: center;

  }
  header img {
    height: 60px;
    margin-left: 1rem;
  }
}
.container {
  flex: 1 0 auto;
  width: 100%;
  max-width: 100vw;
  margin: auto;
  padding: 0rem 1.5rem 2rem 1.5rem;
  background: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

h2 {
    margin-top: 2rem;
    color: #1c3faa;
}
p {
    text-align: justify;
    line-height: 1.6;
}

p.instructions {
    background: #e9f0ff;
    padding: 1rem;
    border-left: 4px solid #1c3faa;
    margin-bottom: 2rem;
    text-align: justify;
}

.notes {
    background: #f8f8f8;
    padding: 1rem;
    border-left: 4px solid gray;
    margin-bottom: 2rem;
    text-align: justify;
}

.holder-block {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

label {
    display: block;
    margin: 0.8rem 0 0.3rem;
    font-weight: 500;
}

input, select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}


.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.col-half {
    flex: 1 1 45%;
}

.step-section {
    display: none;
}

.step-section.active {
  position: relative;
  background-color: rgba(255,255,255,1);
  z-index: 1;
  display: block;
}

.step-section.active::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('logos/icon.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

.form-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

button {
    background-color: #1c3faa;
    color: white;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button.add-holder {
    margin-top: 1rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.holding-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.3rem 1rem;
}

.holding-modes label {
    background-color: #f5f7fb;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 0.4rem 0.6rem 0.4rem 0.4rem;
    align-items: center;
    /* gap: 0.4rem; */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    justify-content: flex-start;
    text-align: left;
}

.holding-modes-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 1rem;
}

.mode-row {
  display: grid;
  grid-template-columns: 80px repeat(5, 1fr);
  gap: 10px;
  align-items: center;
}

.mode-label {
  font-weight: bold;
}

.mode-row label {
  background: #f5f7fa;
  padding: 6px 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  min-width: 90px;
}

.mode-row input[type="checkbox"] {
  margin-right: 6px;
}

@media (max-width: 900px) {
  .mode-row {
    grid-template-columns: 70px repeat(5, 1fr);
    font-size: 13px;
  }
  .mode-row label {
    min-width: 70px;
    font-size: 13px;
    padding: 5px 8px;
  }
}

@media (max-width: 600px) {
  .mode-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .mode-label {
    margin-bottom: 4px;
  }
  .mode-row label {
    min-width: unset;
    width: 100%;
    justify-content: flex-start;
  }
}

input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 10%;
    text-align: left;
}

input[type="radio"] {
    width: 1%;
    text-align: left;
}

.signature-preview img {
    border: 1px solid #ccc;
    padding: 4px;
    background: #fff;
    margin-top: 0.5rem;
    max-width: 200px;
}

.signature-picker { text-align: left; margin-top: 6px; }
.signature-canvas { width: 100%; max-width: 100%; height: auto; touch-action: none; }
.btn-primary { background-color: #1c3faa; color: white; padding: 0.6rem 1.2rem; border: none; border-radius: 5px; cursor: pointer; }
.btn-secondary { background: transparent; color: #1c3faa; padding: 0.45rem 0.9rem; border-radius: 6px; border: 1px solid rgba(28,58,170,0.12); cursor: pointer; }
.btn-draw { background: #f5f7fb; color: #1c3faa; padding: 0.45rem 0.9rem; border-radius: 6px; border: 1px solid rgba(28,58,170,0.08); cursor: pointer; }
.btn-upload { background: #fff; color: #1c3faa; padding: 0.45rem 0.9rem; border-radius: 6px; border: 1px solid rgba(28,58,170,0.12); cursor: pointer; }

.or-sep {
  display: inline-block;
  margin: 0 8px;
  color: #666;
  font-weight: 600;
}

/* Signature modal overrides */
.signature-modal-content { max-width: 760px; }
.signature-canvas-large { width: 100%; height: auto; max-height: 340px; }

/* Signature hint and required indicator */
.signature-hint {
  font-size: 0.92rem;
  color: #444;
  margin-top: 6px;
}
.signature-required-note {
  display: inline-block;
  margin-left: 8px;
  color: #b00020;
  font-weight: 600;
  font-size: 0.9rem;
}
.signature-picker .actions-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

footer {
  margin-top: auto;
  width: 100%;
  background-color: #f2f2f2;
  padding: 1.5rem 2rem;
  font-size: 0.9rem;
  color: #333;
  border-top: 1px solid #ddd;
}

.footer-columns {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 95%;
}

/* RM Code input card */
.rm-code-container {
  display: none; /* shown by JS when needed */
  padding: 18px 12px;
}
.rm-card {
  max-width: 520px;
  margin: 22px auto;
  background: #ffffff;
  border-radius: 12px;
  padding: 20px 20px;
  box-shadow: 0 6px 18px rgba(21,31,56,0.08);
  border: 1px solid rgba(28,58,170,0.04);
  box-sizing: border-box;
}
.rm-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}
.rm-tab {
  flex: 1;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #6c757d;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  bottom: -2px;
}
.rm-tab:hover {
  color: #1c3faa;
  background: #f8f9fa;
}
.rm-tab.active {
  color: #1c3faa;
  border-bottom-color: #1c3faa;
  font-weight: 600;
}
.rm-tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}
.rm-tab-content.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.service-rm-code-spacing {
  margin-bottom: 12px;
}
.invalid-link-msg {
  display: none;
  text-align: center;
  margin: 40px auto;
  font-size: 1.2rem;
  color: #b00;
  background: #fff3f3;
  padding: 30px 10px;
  border-radius: 8px;
  max-width: 500px;
}
.rm-loader {
  display: none;
  text-align: center;
  margin: 40px auto;
}
.rm-loader-inner {
  display: inline-block;
  padding: 20px 30px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.rm-loader-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #eee;
  border-top-color: #007bff;
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin 1s linear infinite;
}
.rm-loader-text {
  font-size: 1rem;
  color: #333;
}
.rm-mode-notice {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 15px;
  margin-bottom: 20px;
}
.rm-mode-notice h4 {
  margin: 0 0 10px 0;
  color: #1976d2;
}
.rm-mode-notice p {
  margin: 0;
  color: #424242;
}
.label-margin-top {
  margin-top: 1rem;
  display: block;
}
.form-nav-margin {
  margin-top: 1rem;
}
.rm-step-notice {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  padding: 12px;
  margin-bottom: 15px;
}
.rm-step-notice p {
  margin: 0;
  color: #e65100;
  font-weight: 500;
}
.nominee-section {
  margin-top: 1rem;
  display: none;
}
.no-nominee-text {
  display: none;
  margin-top: 1rem;
  background: #fff4e5;
  padding: 1rem;
  border-left: 4px solid orange;
}
.no-nominee-inner {
  margin-top: 0.6rem;
}
.pan-uppercase {
  text-transform: uppercase;
}
.signature-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.signature-file-hidden {
  display: none;
}
.signature-canvas-wrap {
  display: none;
  margin-top: 10px;
}
.signature-canvas {
  border: 1px solid #ddd;
  border-radius: 6px;
  touch-action: none;
}
.signature-canvas-buttons {
  margin-top: 6px;
  display: flex;
  gap: 8px;
}
.demat-heading {
  margin-top: 2rem;
}
.email-verification-disabled {
  margin-top: 20px;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: #f9f9f9;
  opacity: 0.7;
}
.email-verification-disabled p {
  color: #666;
}
.instructions-box {
  background: #f7f7f7;
  border-left: 4px solid #1c3faa;
  padding: 10px;
}
.risk-controls {
  margin-top: 15px;
}
.skip-risk-button {
  margin-left: 10px;
  background: #757575;
}
.risk-result-highlight {
  display: none;
}
.risk-matrix {
  display: none;
}
.custom-risk-section {
  margin-top: 20px;
  display: none;
}
.ack-section {
  margin: 12px 0;
  text-align: center;
}
.ack-label {
  font-weight: 600;
}
.ack-value {
  margin: 6px 0;
  font-size: 1.1rem;
  color: #007bff;
  word-break: break-all;
}
.ack-copy-controls {
  margin-top: 8px;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.signature-modal-content {
  max-width: 760px;
}
.signature-modal-canvas-wrap {
  padding: 8px 0;
}
.signature-modal-canvas {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}
.signature-modal-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}
.rm-card h3 {
  margin: 0 0 12px 0;
  font-size: 1.15rem;
  color: #1c3faa;
}
.rm-code-input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #d9dff6;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  margin-bottom: 12px;
  font-size: 1rem;
}
.rm-code-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 6px;
}
.rm-code-actions .btn-primary {
  background: #1c3faa;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
.rm-code-actions .btn-primary:disabled {
  background: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}
.rm-code-actions .btn-secondary {
  background: transparent;
  color: #1c3faa;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(28,58,170,0.12);
  cursor: pointer;
}
.rm-code-error {
  margin-top: 10px;
  color: #b00020;
  font-size: 0.95rem;
}

@media (max-width: 520px) {
  .rm-card {
    margin: 16px;
    padding: 16px;
  }
  .rm-card-logo { height: 42px; }
  .rm-code-input { font-size: 0.95rem; }
  .rm-code-actions { flex-direction: column; gap: 8px; }
  .rm-code-actions .btn-primary, .rm-code-actions .btn-secondary { width: 100%; }
}

.footer-left {
  flex: 1 1 50%;
  font-size: 1rem;
  line-height: 1.3;
  flex-direction: column;
  justify-content: center;
}

.footer-right {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 1rem;
  line-height: 1.3;
  text-align: right;
}

.footer-right .contact-details {
  display: flex; 
  align-items: center;
}

.footer-right .contact-icon {
  margin-right:6px;
}

footer a {
    color: #1c3faa;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .footer-columns {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    }
    .footer-left, .footer-right {
    justify-content: center;
    text-align: center;
    width: 100%;
    font-size: 0.75rem;
    }
    .footer-right {
    flex-wrap: wrap;
    gap: 0.3rem !important;
    }
    .footer-right .contact-details {
    margin-bottom: 0.2rem;
  }
}

/* Step 0 */
.terms-box {
  max-height: 100%;
  overflow-y: auto;
  border: 1px solid #ccc;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: justify;
}

.terms-content {
  column-count: 2;
  column-gap: 5rem;
}

@media screen and (max-width: 768px) {
  .terms-content {
    column-count: 1;
  }
}

.risk-question-text {
  font-weight: bold;
  margin-bottom: 10px;
}

.risk-options label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.risk-result-highlight {
  background: #e6f7ff;
  border-left: 5px solid #1c3faa;
  padding: 20px;
  margin-top: 30px;
  display: none;
  border-radius: 4px;
}

.risk-result-highlight h2 {
  color: #1c3faa;
  font-size: 24px;
  margin-bottom: 10px;
}

#risk-description {
  font-size: 16px;
  color: #333;
}

.risk-matrix-wrapper {
  overflow-x: auto;
  margin-top: 15px;
}

.risk-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.risk-matrix-table th,
.risk-matrix-table td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: left;
}

.risk-matrix-highlight {
  background-color: #fffae6;
  border-left: 4px solid #f1c40f;
}

.custom-risk-box {
  display: none;
  margin-top: 15px;
}

.custom-risk-box select,
.custom-risk-box textarea {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 12px;
}

.fatca-holder-section {
  border: 1px solid #ccc;
  padding: 20px;
  margin-bottom: 25px;
  border-radius: 5px;
  background-color: #fdfdfd;
}

.fatca-holder-section h3 {
  color: #1c3faa;
}

.fatca-holder-section label {
  display: block;
  margin-top: 10px;
  font-weight: 500;
}

.fatca-holder-section input,
.fatca-holder-section select {
  width: 100%;
  padding: 6px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.fatca-declaration {
  background: #f9f9f9;
  border-left: 4px solid #1c3faa;
  padding: 10px;
  margin-top: 15px;
}

/* Uploaded Proofs Container */
.uploaded-proofs-container {
  background: #e8f4f8;
  border: 2px solid #b3d9e6;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 20px;
}

.uploaded-proofs-container:empty {
  display: none;
}

.document-item {
  padding: 8px;
  background: white;
  border-radius: 4px;
  margin-bottom: 8px;
}

.document-item a {
  color: #007bff;
  text-decoration: none;
  margin-left: 10px;
}

.document-item a:hover {
  text-decoration: underline;
}

#documentsList {
  background: #e8f4f8;
  border: 2px solid #b3d9e6;
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
}

#documentsList:empty {
  display: none;
}
.fatca-declaration input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}