/*
  IDMIS login theme — additions on top of the webapp's /css/portal.css, which
  template.ftl links first and which provides the auth shell, fields and buttons.
  Everything here is markup that only Keycloak's templates produce.
*/

.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}

/* ---- Card header: back link + SQ/EN switch ---- */
.kc-card-top{
  display:flex;align-items:center;justify-content:space-between;gap:var(--sp-4);
  margin-bottom:var(--sp-6);
}
.kc-card-top .auth-back{margin-bottom:0}
.kc-lang{flex:none;cursor:default}
.kc-lang .lang-opt{color:inherit}
.kc-lang .lang-opt:hover{opacity:1}

.kc-username{
  display:flex;align-items:baseline;flex-wrap:wrap;gap:var(--sp-3);
  margin-bottom:var(--sp-5);font-size:var(--ts-sm);font-weight:600;color:var(--ink);
}
.kc-required-note{margin-bottom:var(--sp-4);font-size:var(--ts-xs);color:var(--ink-soft)}
/* Base pages have no intro note under the title; give their form the same breathing room. */
.auth-title + form,
.auth-title + .form-alert,
.auth-title + .instruction{margin-top:var(--sp-5)}
.required{color:var(--danger);font-weight:700}

/* ---- Alerts: portal.css styles .form-alert as an error; add the other types ---- */
.auth-card > .form-alert{margin-bottom:var(--sp-5)}
.form-alert-success{border-color:#b7dcbc;border-left-color:var(--green-600);background:var(--green-100);color:var(--green-800)}
.form-alert-info{border-color:var(--water-300);border-left-color:var(--water-700);background:var(--water-100);color:var(--water-700)}
.form-alert-warning{border-color:#f1d59c;border-left-color:#b7791f;background:#fffaeb;color:#8a5a12}

/* ---- Fields rendered by base templates (kc*Class mappings in theme.properties) ---- */
.kc-label-row{display:flex;align-items:baseline;gap:4px}
.field-input{display:flex;flex-direction:column;gap:6px}
.field-group-header{font-size:var(--ts-sm);font-weight:700;color:var(--ink)}
.field textarea{
  font:inherit;font-size:var(--ts-sm);color:var(--ink);width:100%;
  padding:12px 13px;background:var(--surface);border:1px solid var(--line);border-radius:6px;
}

/* portal.css sizes every `.field input` as a text box; undo it for checkboxes,
   radios and the <input type="submit"> buttons the base templates use. */
.field input[type="checkbox"],
.field input[type="radio"]{width:16px;height:16px;padding:0;flex:none;margin-top:1px;accent-color:var(--green-700)}
.field input.btn{
  width:auto;padding:12px 24px;border-radius:999px;border:1.5px solid transparent;
  font-size:var(--ts-base);font-weight:600;cursor:pointer;
}
.field input.btn-primary{background:var(--btn-bg);color:#fff}
.field input.btn-primary:hover,
.field input.btn-primary:focus{background:var(--green-800);border-color:transparent}
.field input.btn-secondary{background:transparent;color:var(--green-800);border-color:var(--green-600)}
.field input.btn-secondary:hover{background:var(--green-100)}
.field input.btn-block{width:100%}

.checkbox label,
.field .checkbox label{
  display:flex;align-items:flex-start;gap:9px;
  font-size:var(--ts-sm);font-weight:400;letter-spacing:normal;
  color:var(--ink-soft);cursor:pointer;line-height:1.45;
}
.kc-form-options{display:flex;flex-direction:column;gap:var(--sp-2);font-size:var(--ts-sm)}
.kc-form-buttons{display:flex;flex-wrap:wrap;gap:var(--sp-3);margin-top:var(--sp-2)}
.kc-form-buttons .btn{flex:1 1 auto}

/* ---- Links inside the card (base pages: "back to login", "click here", …) ---- */
.kc-form-options a,
.kc-aux-form a,
.auth-card .instruction a,
#kc-info a{
  font-weight:600;color:var(--green-700);text-decoration:underline;text-underline-offset:3px;
}
.kc-form-options a:hover,
.kc-aux-form a:hover,
.auth-card .instruction a:hover,
#kc-info a:hover{color:var(--green-800)}
.kc-aux-form{margin-top:var(--sp-4);text-align:center;font-size:var(--ts-sm)}
.auth-card .instruction{font-size:var(--ts-sm);line-height:1.6;color:var(--ink-soft);margin-bottom:var(--sp-4)}

/* ---- Identity providers (none configured today; kept usable for later) ---- */
.kc-social{margin-top:var(--sp-5)}
.kc-social-label{margin-bottom:var(--sp-3);font-size:var(--ts-xs);font-weight:600;letter-spacing:.04em;color:var(--ink-soft)}
.kc-social-list{display:flex;flex-direction:column;gap:var(--sp-2)}

/* ---- Password visibility: base js/passwordVisibility.js swaps these classes on the <i> ---- */
.idmis-icon{
  display:block;width:17px;height:17px;background:currentColor;
  -webkit-mask:var(--idmis-icon) center/contain no-repeat;
          mask:var(--idmis-icon) center/contain no-repeat;
}
.idmis-icon-eye{
  --idmis-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}
.idmis-icon-eye-off{
  --idmis-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.88 9.88a3 3 0 1 0 4.24 4.24'/%3E%3Cpath d='M10.73 5.08A10.4 10.4 0 0 1 12 5c7 0 10 7 10 7a13.2 13.2 0 0 1-1.67 2.68'/%3E%3Cpath d='M6.61 6.61A13.5 13.5 0 0 0 2 12s3 7 10 7a9.7 9.7 0 0 0 5.39-1.61'/%3E%3Cpath d='M2 2l20 20'/%3E%3C/svg%3E");
}
.pass-toggle:has(.idmis-icon-eye-off){color:var(--green-700)}
