/*  FORM  */
.sf form, div.form-block, div.form-group, .sf .items {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}
.sf * { transition: all 0s; }
.sf {
    width: 35rem;
    max-width: 100%;
 }
.sf h2 {
    width: fit-content;
    max-width: 100%;
}
.sf p {
    white-space: pre-wrap;
}
.sf form {
    width: 100%;
    padding: 3rem 0rem;
    gap: 4.5rem;
}
.sf .trailingButtons {
    width: 100%;
    
    display: flex;
    flex-direction: row;
    gap: 1rem;
}


/*  FIELD & GROUP CONTAINERS  */
.sf .form-block, .sf .form-group, .form-group .items, 
.sf .dropdown-container { 
    width: 100%;
    border-radius: .5rem;
 }
.sf .form-block, .sf .form-group { gap: .75rem; }


/*  FIELD  */
.sf .field {
    width: 100%;
    padding: 1rem 1.5rem;
    background-color: var(--bjl-color-background);
    border: solid 0.2rem var(--bjl-color-secondary);
    border-radius: 0.5rem;
    font-size: var(--bjl-font-size-md);
}
.sf .disabled .field {
	cursor: not-allowed;
    border-color: transparent;
	background-color: var(--bjl-color-disabled);
}
.sf .items .field { 
    border-radius: 0;
    border-top: none;
}
.sf .items .form-block:first-of-type .field { 
    border-radius: 0.5rem 0.5rem 0 0;
    border-top: solid 0.2rem var(--bjl-color-secondary);
}
.sf .items .form-block:last-of-type .field { 
    border-radius: 0 0 0.5rem 0.5rem;
}


/*  FIELD - label  */
.sf label *, .sf legend * { 
    padding-left: .5rem;
    font-size: .75rem; 
    font-weight: 400;
}
.sf label, .sf legend {
    position: absolute;
    top: -.65rem;
    left: 1rem;

    padding: .2rem .75rem;
    background-color: var(--bjl-color-background);

    font-size: .75rem; 
    font-weight: 700;

    z-index: 1;
}


/*  FIELD:placeholder  */
.sf input::placeholder, .sf textarea::placeholder,
.sf .dropdown-container .option-empty:not(.redact) { color: var(--bjl-color-text-secondary); }


.sf .checkbox,
.sf .switch,
.sf .dropdown, .sf .option,
.sf input[type="button"],
.sf input[type="color"],
.sf input[type="file"],
.sf input[type="submit"]
{ cursor: pointer; }


/*  FIELD - textarea  */
.sf textarea { 
    min-height: 10rem;
    resize: none;
}


/*  FIELD - switch  */
.sf .switch, .sf .dropdown, .sf .checkbox { 
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
.sf .switch-container {
    min-width: 4.5rem;
    min-height: calc(100% - 1rem);
    height: 2.3333rem;
    background-color: var(--bjl-color-secondary);

    position: absolute;
    right: 0.5rem;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: .6rem;

    border-radius: .5rem;
    overflow: hidden;
}
.sf .switch-container span {
    color: var(--bjl-color-text-secondary);
    font-size: 1.5rem;
    z-index: 2;
}
.sf .switch[aria-checked="false"] .switch-container span:first-of-type,
.sf .switch[aria-checked="true"] .switch-container span:last-of-type {
    color: var(--bjl-color-secondary);
}
.sf .switch .switch-state {
    aspect-ratio: 1/1;
    min-height: calc(100% - 0.5rem);
    background-color: var(--bjl-color-background);
    margin: 0.25rem;

    position: absolute;
    top: 0;
    left: 0;

    border-radius: .35rem;
    transition: all .5s;
}
.sf .switch[aria-checked="true"] .switch-state {
    left: 47%;
    background-color: var(--bjl-color-text);
    transition: all .25s;
}


/*  FIELD - dropdown  */
.sf .option-container {
    position: absolute;
    min-width: 100%;
    padding: .75rem;
    background-color: var(--bjl-color-secondary);

    display: flex;
    flex-direction: column;
    gap: .5rem;

    z-index: 2;
    border-radius: 0 0 .5rem .5rem;
}
.sf .dropdown-container.active { 
    background-color: var(--bjl-color-secondary); 
    border-radius: .5rem .5rem 0 0;
}
.sf .option-container > div, .sf .option { 
    width: 100%;
    padding: .5rem;
    padding-left: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;

    border-radius: .5rem;
}
.sf .dropdown > span:first-of-type,
.sf .option > span { 
    width: 80%;
    word-break: break-word;
 }
.sf .dropdown > span:first-of-type { width: 81%;}
.sf .option:hover { background-color: var(--bjl-color-disabled); }
.sf div.option.active { 
    background-color: var(--bjl-color-text); 
    color: var(--bjl-color-secondary);
}
.sf .option.active * { color: var(--bjl-color-secondary); }


/*  FIELD - dropdown - EDITING FEATURE  */
.sf .option.adding-container .edit-details {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: .5rem;
}
.sf div.option input {
    height: 100%;
    margin: 0;
    padding-right: 8em;
    position: absolute;
    left: 0;
    background-color: transparent;

    color: var(--bjl-color-text);
    font-size: inherit;
    border: none;
    cursor: text;
}
.sf div.option input:hover { background-color: transparent; }
.sf div.option input::placeholder { color: var(--bjl-color-text-secondary); }
.sf div.option.active input::placeholder { color: var(--bjl-color-disabled); }
.sf .option-actions {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: .5rem;
}
.sf .option-actions span { 
    padding: .5rem;
    border-radius: .5rem;
}
.sf .option-actions span:hover { background-color: var(--bjl-color-text-secondary); }
.sf div.option.active .option-actions span:hover { 
    color: var(--bjl-color-text);
    background-color: var(--bjl-color-disabled); 
}
.sf .option-del { display: none; }
.sf .option:hover .option-del, 
.sf .option.active .option-del 
{ display: flex; }


/*  FIELD - divider  */
.sf .divider {
    min-width: 100%;

    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1.25rem;
}
.sf .divider span:first-of-type { font-size: 2rem; }
.sf .divider span:last-of-type {
    max-width: 50%;
    font-weight: bold;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.sf .divider hr {
    width: 100%;
    height: 0.25rem;
    margin-left: 1rem;
    background-color: var(--bjl-color-text);

    border: 0.1rem solid var(--bjl-color-text);
    flex-shrink: 1;
}


/*  FIELD - feedback  */
.sf .container-tooltip, .sf .container-validity, 
.sf .container-preview {
    display: none;

    min-width: 97%;
    max-width: 97%;
    padding: .75rem 1rem;
    margin: 0 1.5%;

    border-radius: .25rem;
}
.sf .container-tooltip {
    background-color: var(--bjl-color-secondary);

    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
}
.sf .container-tooltip span { 
    padding-right: 1rem; 
    font-size: 1.25rem;
}

.sf .container-validity.active {
    display: flex;
    flex-direction: column;
    border: solid var(--bjl-color-secondary) .1rem;
}
.sf .condition-true { color: var(--bjl-color-success); }
.sf .condition-false { color: var(--bjl-color-error); }

.sf .field.redact::after,
.sf .container-preview.redact::after {    
    content: '[redacted]';
    color: var(--bjl-color-text);   
    text-align: center; 
    
    position: absolute;
    background-color: var(--bjl-color-background);
    padding: 1rem;
    padding-left: 1.5rem;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    box-sizing: border-box;
    border-radius: 0.5rem;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}
.sf .container-preview.redact::after {
    padding: 0;
    border: .25rem solid var(--bjl-color-secondary);
    align-items: center;
}
.sf .container-preview.active {
    background-color: var(--bjl-color-secondary);
    padding: 1rem;

    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;

    overflow: hidden;
}
.sf .preview {
    width: 6rem;
    height: 6rem;

	gap: 0.25em;
    padding: .5rem;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    background-color: var(--bjl-color-background);
    border-radius: 10px;
}
.sf .preview * { color: var(--bjl-color-text); }
.sf .preview span { font-size: 3rem !important; }
.sf .preview p {
	font-size: .8rem;
    white-space: nowrap;
    width: 4rem;
    text-overflow: ellipsis;
    overflow: hidden;
    display: inline-block;
}

.sf .field.redact:hover::after, 
.sf .field.redact:focus::after,
.sf .container-preview:hover::after,
.sf .container-preview:focus::after
{ display: none; }

.sf .form-block.warn .field { border-color: var(--bjl-color-error) !important; }
.sf .form-group.warn .items {
    outline: solid 0.2rem var(--bjl-color-error);
    border-radius: 0.5rem;
 }
.sf .warn label, .sf .warn legend,
.sf .warn label *, .sf .warn legend * { color: var(--bjl-color-error) !important; }


/*  FORM - hide aria  */
.sf #aria {
    display: flex;
}
.sf .for-aria { 
    max-width: 0;
    max-height: 0;
    margin: 0;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
 }