:root {
    --header-color: #dc140a;
    --primary-color: #0077df;
    --white-color: #FDFBFF;
    --border-color: #DFDEE3;
    --error-color: #d32f2f;
    --text-primary: #201f23;
    --text-secondary: rgba(32, 31, 35, 0.6);
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    margin: 0;
}

.main-container, .main-container-wide {
    font-family: 'Montserrat';
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    flex-direction: column;
    border-radius: 16px;
    -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5);
    box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    width: 414px;
}

.main-container-wide {
    width: 742px;
}

.background-container {
    position: absolute;
    z-index: -1;
    background-image: url('background.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
    height: 100%;
    width: 100vw;
    filter: blur(10px);
}

.background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 30%;
}

.logo {
    z-index: 2;
    margin: 8px 24px;
    width: 144px;
    height: 27px;
}

.logo_staff {
    z-index: 2;
    margin: 8px 32px;
    width: 148px;
    height: 41px;
}

.main-header, .main-header-wide {
    position: relative;
    width: 100%;
    height: 110px;
    padding: 32px 8px 8px;
    border-radius: 16px 16px 0px 0px;
    display: flex;
    background-color: var(--header-color);
}

.main-header::before, .main-header-wide::before {
    content: '';
    background-color: var(--border-color);
    border-radius: 50%;
    transform: rotate(-14deg);
    z-index: 0;
    position: absolute;
    top: 120px;
    left: -560px;
    width: 1185px;
    height: 450px;
}

.main-header-wide::before {
    top: 118px;
    left: -555px;
    width: 1415px;
    height: 535px;
}

.main-header::after, .main-header-wide::after {
    content: '';
    background-color: var(--white-color);
    border-radius: 50%;
    transform: rotate(-14deg);
    z-index: 1;
    position: absolute;
    top: 140px;
    left: -665px;
    width: 1245px;
    height: 450px;
}

.main-header-wide::after {
    top: 135px;
    left: -640px;
    width: 1490px;
    height: 570px;
}

.main-body {
    width: 100%;
    box-sizing: border-box;
    padding: 0 32px 20px;
    background-color: var(--white-color);
    border-radius: 0px 0px 16px 16px;
    z-index: 2;
}

.main-body_title {
    font-size: 24px;
    font-weight: 600;
}

.main-body table {
    width: 100%;
    margin-bottom: 24px;
    table-layout: fixed;
    border: 1px solid var(--border-color);
    opacity: 0.9;
    border-radius: 8px;
}

.main-body table th {
    font-weight: bold;
}

.main-body table th,
.main-body table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(31, 31, 35, 0.08);
    font-family: Roboto, sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-primary);
    text-overflow: ellipsis;
    overflow: hidden;
}

.main-body table tbody tr:last-child td {
    border-bottom: none;
}

.main-body table.empty {
    margin-top: 24px;
}

.main-body table.empty td {
    padding: 32px;
    text-align: center;
}

.device-card {
    display: none;
    position: relative;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: Roboto, sans-serif;
    margin-bottom: 12px;
}

.device-card:last-child {
    margin-bottom: 0;
}

.device-card .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.device-card .row:last-child {
    margin-bottom: 0;
}

.device-card .row .item {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    text-overflow: ellipsis;
    overflow: hidden;
}

.device-card .row .item .label {
    font-weight: 500;
    margin: 0 0 4px 0;
    text-overflow: ellipsis;
    overflow: hidden;
}

.device-card .row .item .value {
    margin: 0;
    text-overflow: ellipsis;
    overflow: hidden;
}

.device-card .delete-icon-button {
    position: absolute;
    top: 10px;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.device-card .deleted {
    color: var(--error-color);
    font-size: 12px;
    margin-bottom: 0;
}

.title-bar {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-primary);
    font-family: Montserrat, sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 160%;
    letter-spacing: 0.15px;
    padding-top: 20px;
}

.title-text {
    flex: 1;
}

.title-bar button {
    display: flex;
    height: 34px;
    padding: 6px 16px;
    justify-content: center;
    align-items: center;
    width: 150px;
    background: #007bff;
    color: var(--white-color);
    font-family: Roboto;
    font-size: 12px;
    font-weight: 600;
    line-height: 22px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.title-bar button:hover {
    background: #0056b3;
}

.subtitle, .subtitle-deleted {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1 0 0;
    align-self: stretch;
    font-feature-settings: 'liga' off, 'clig' off;

    font-family: Roboto;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 160%;
    letter-spacing: 0.17px;
    margin: 10px 0;
}

.subtitle-deleted {
    color: var(--error-color);
}

input[type='text'],
input[type='number'],
input[type='password'] {
    width: 100%;
    padding: 16px 12px;
    display: inline-block;
    border: 1px solid var(--components-input-outlined-enabledBorder, #e0e0e0);
    box-sizing: border-box;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--white-color);
    font-family: 'Roboto';
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type='number'] {
    -moz-appearance: textfield;
}

.input-wrapper {
    position: relative;
}

.input-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--white-color);
    padding: 0 0.3rem;
    margin: 0 0.5rem;
    transition: 0.1s ease-out;
    transform-origin: left top;
    pointer-events: none;
    font-family: 'Roboto';
    font-size: 16px;
    font-weight: 400;
    color: var(--text-secondary);
}

.form-radio-input {
    margin: 0;
}

.radio-label {
    font-family: 'Roboto';
    font-size: 16px;
    font-weight: 400;
    color: var(--text-primary);
}

.form-text-input {
    font-size: 1rem;
    outline: none;
    border: 1px solid gray;
    border-radius: 5px;
    padding: 1rem 0.7rem;
    color: gray;
    transition: 0.1s ease-out;
}

.form-text-input:focus {
    border-color: #616161;
    box-shadow: 0 0 0 1px #616161;
}

label:has(+ .form-text-input:focus) {
    color: #616161;
    top: 0;
    transform: translateY(-50%) scale(0.9) !important;
    font-size: 12px;
}

.form-text-input:not(:placeholder-shown) {
    border-color: #616161;
    box-shadow: 0 0 0 1px #616161;
}

label:has(+ .form-text-input:not(:placeholder-shown)) {
    top: 0;
    transform: translateY(-50%) scale(0.9) !important;
    font-size: 12px;
}

.form-text-input:not(:focus)::placeholder {
    opacity: 0;
}

.form-text-input.mfa {
    font-size: 24px;
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 8px 22px;
    height: 56px;
    border: none;
    cursor: pointer;
    width: 100%;
    border-radius: 28px;
    text-transform: uppercase;
    letter-spacing: 1.46px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Roboto';
}

button:hover {
    opacity: 0.8;
}

button[disabled] {
    background-color: lightgray;
}

button[disabled]:hover {
    cursor: default;
    opacity: 1;
}

.form-header {
    text-align: left;
}

.form-header.mfa {
    text-align: center;
}

.form-header.mfa img {
    margin-bottom: -1em;
    width: 42px;
}

.form-content {
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-qr {
    text-align: center;
}

.form-qr .error {
    color: var(--error-color);
    font-weight: bold;
}

.form-remember {
    display: flex;
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Roboto';
}

.form-remember input {
    margin: 0 10px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    border-color: #bbbac0;
}

.form-remember small {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
}

.remember-checkbox:not(:checked) {
    -moz-appearance: none;
    -webkit-appearance: none;
    -o-appearance: none;
    appearance: none;
    border: 2px solid #bbbac0;
    border-radius: 2px;
}

.remember-checkbox {
    accent-color: var(--text-primary);
}

.form-header h2 {
    margin-bottom: 24px;
    font-weight: 500;
}

.form-footer {
    display: flex;
    justify-content: space-between;
    text-align: center;
}

.form-header p,
.form-footer p,
.form-footer button {
    font-size: 14px;
    color: #666;
}

.form-footer p {
    margin: 0 0 20px;
    font-family: 'Roboto';
    line-height: 160%;
    color: var(--text-secondary);
}

.form-footer button {
    background: none;
    border: none;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
    width: auto;
    margin: 0 0 0 25px;
    text-transform: none;
    font-family: 'Montserrat';
}

.form-footer p ~ a {
    font-family: 'Roboto';
    color: var(--text-primary);
    text-underline-offset: 4px;
}

.form-footer a + a {
    margin-left: 16px;
}

.form-footer.mfa {
    display: block;
}

.forgot-password {
    font-family: 'Roboto';
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 400;
    text-underline-offset: 4px;
}

.error-wrapper {
    border-radius: 4px;
    border: 1px solid var(--error-color);
    padding: 6px 16px;
    font-family: 'Roboto';
    font-size: 16px;
    display: flex;
    color: #5f2120;
    gap: 12px;
}

.error-icon {
    margin-top: 8px;
}

.error-text {
    padding: 8px 0;
    line-height: 150%;
}

.error-state input:not(.remember-checkbox) {
    border-color: var(--error-color) !important;
    box-shadow: none !important;
}

.error-state label:not(.label-remember) {
    color: var(--error-color);
}

.delete-icon-button {
    background: none;
    border: none;
    cursor: pointer;
    justify-content: flex-start;
    display: flex;
    align-items: center; /* vertical centering */
    padding: 0 0 0 10px;
}

.delete-icon-button svg {
    transition: opacity 0.2s ease;
}

.delete-icon-button:hover svg {
    opacity: 0.6;
}

#confirm-modal {
    background: var(--white-color);
    padding: 1em;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 560px;
}

#confirm-modal .cancel-cross {
    cursor: pointer;
    position: absolute;
    top: 18px;
    right: 14px;
}

#confirm-modal::backdrop {
    background:rgba(0,0,0,0.5);
}

#confirm-modal h2 {
    margin-top:0;
    font-size: 20px;
    font-weight: 500;
}

#confirm-modal-text {
    margin-bottom: 1.5em;
    font-size: 15px;
    line-height: 150%;
}

#confirm-modal-buttons {
    display: flex;
    gap: 1em;
    justify-content: right;
}

#confirm-modal-buttons button {
    width: auto;
    height: auto;
    font-size: 12px;
    padding: 8px 15px;
}

#confirm-yes {
    background: var(--header-color);
    color: var(--white-color);
}

#confirm-no {
    background: none;
    color: var(--text-secondary);
}

@media only screen and (max-width: 640px) {
    .main-body table {
        display: none;
    }

    .main-body table.empty {
        display: table;
    }

    .device-card {
        display: block;
    }
}

@media only screen and (max-width: 430px) {
    body {
        align-items: flex-start;
    }

    .background-container {
        display: none;
    }

    .logo {
        margin: 8px 16px;
    }

    .logo_staff {
        margin: 8px 16px;
    }

    .main-container, .main-container-wide {
        border-radius: 0;
        box-shadow: none;
        width: 100vw;
    }

    .main-header, .main-header-wide {
        width: 100vw;
        border-radius: 0;
    }

    .main-body {
        padding: 0 16px 24px;
    }
}
