:root {
    --bf-primary: var(--ih-tertiary-500);
    --bf-body-bg: var(--ih-surface-page);
    --bf-black: var(--ih-neutral-900);
    --bf-blue: var(--ih-primary-500);
    --bf-grey: var(--ih-neutral-500);
    --bf-light-grey: var(--ih-neutral-300);
    --bf-white: #ffffff;
    --bf-success: #16a34a;
    --info: var(--ih-secondary-500);
    --warning: #f59e0b;
    --danger: var(--ih-color-danger);
    --dark: var(--ih-neutral-900);
}

/*
 * --------------------------------------------------------------------------
 * LAYOUT
 * --------------------------------------------------------------------------
 */
body {
    font-size: 0.875rem;
    background: var(--bf-body-bg);
    font-family: var(--ih-font-body);
}

.ih-auth-card {
    background: var(--ih-surface-card);
    border: none;
    border-radius: var(--ih-radius-md);
    box-shadow: var(--ih-shadow-card);
}

.ih-auth-theme .form-control {
    border-radius: var(--ih-radius-md);
    min-height: 38px;
    font-size: 0.875rem;
}

.ih-auth-theme .form-control:focus {
    border-color: var(--ih-primary-500);
    box-shadow: var(--ih-focus-ring);
}

.ih-auth-theme .btn-primary {
    border-radius: var(--ih-radius-md);
    min-height: 38px;
}

.ih-auth-theme a {
    color: var(--ih-primary-500);
}

.ih-auth-theme a:hover {
    color: var(--ih-secondary-700);
}

/* Full-screen auth pages (login, magic link, 2FA) */
.ih-auth-theme:has(.ih-login-page) header.navbar,
.ih-auth-theme:has(.ih-login-page) #alerts-wrapper {
    display: none;
}

.ih-auth-theme:has(.ih-login-page) .main,
.ih-auth-theme:has(.ih-login-page) .main main {
    padding: 0 !important;
    margin: 0 !important;
}

.ih-login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ih-surface-page) center center / cover no-repeat;
    background-image: url('/img/background.jpg');
}

.ih-login-card {
    position: relative;
    z-index: 1;
    width: min(400px, calc(100vw - 2rem));
    margin-top: 2rem;
    background: var(--ih-surface-card);
    border: none;
    border-radius: var(--ih-radius-md);
    box-shadow: var(--ih-shadow-card);
    text-align: center;
}

.ih-login-card .card-body {
    padding: 1.5rem;
}

.ih-login-logo {
    width: min(240px, 80%);
    max-width: 100%;
    margin: -5rem auto 1rem;
    display: block;
}

.ih-login-subtitle {
    color: var(--ih-color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.ih-login-input-wrap {
    position: relative;
    margin-bottom: 0.75rem;
}

.ih-login-input-wrap .form-control {
    min-height: 38px;
    padding-right: 2rem;
}

.ih-login-input-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ih-neutral-400);
    font-size: 0.875rem;
    pointer-events: none;
}

.ih-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0;
}

.ih-login-options .form-check {
    margin: 0;
    text-align: left;
}

.ih-login-options .form-check-label {
    font-size: 0.875rem;
    color: var(--ih-color-text);
    font-weight: var(--ih-font-weight-semibold);
}

.ih-login-meta {
    text-align: right;
    margin: 0.5rem 0 0;
    color: var(--ih-color-text-muted);
    font-size: 0.75rem;
}

.magic-link-info {
    color: var(--ih-color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.magic-feedback {
    margin: 0.35rem 0 0.75rem;
    border-radius: var(--ih-radius-md);
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    text-align: left;
    border: 1px solid transparent;
}

.magic-feedback.info {
    color: var(--ih-tertiary-600);
    background: var(--ih-primary-50);
    border-color: var(--ih-primary-200);
}

.magic-feedback.error {
    color: var(--ih-color-danger-hover);
    background: #fee2e2;
    border-color: #fecaca;
}

.magic-feedback ul {
    margin: 0;
    padding-left: 1rem;
}

.nav-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
}

/*
 * --------------------------------------------------------------------------
 * PASSWORDS
 * --------------------------------------------------------------------------
 */
div#pass-meter {
    display: flex;
    flex-direction: column-reverse;
}

div#pass-meter .segment {
    display: block;
    background: var(--bf-white);
    border: 1px solid var(--bf-light-grey);
    height: 9px;
    width: 30px;
}

div#pass-meter .segment:last-child {
    margin-right: 0;
}

div#pass-meter.good .segment {
    background-color: var(--bf-success);
    border-color: var(--bf-success);
    border-bottom: 1px solid var(--bf-white);
}

div#pass-meter.warn .segment {
    background-color: var(--warning);
    border-color: var(--warning);
    border-bottom: 1px solid var(--bf-white);
}

div#pass-meter.bad .segment {
    background-color: var(--danger);
    border-color: var(--danger);
}

div#pass-meter.str-1 .segment:nth-child(2),
div#pass-meter.str-1 .segment:nth-child(3),
div#pass-meter.str-1 .segment:nth-child(4) {
    background-color: var(--bf-white);
    border-color: var(--bf-light-grey);
}

div#pass-meter.str-2 .segment:nth-child(3),
div#pass-meter.str-2 .segment:nth-child(4) {
    background-color: var(--bf-white);
    border-color: var(--bf-light-grey);
}

div#pass-meter.str-3 .segment:nth-child(4) {
    background-color: var(--bf-white);
    border-color: var(--bf-light-grey);
}

#pass-suggestions {
    text-align: center;
    color: var(--bf-grey);
    font-size: 0.8rem;
    margin-top: -15px;
    margin-bottom: 10px;
    min-height: 2.5rem;
}

.pass-match-wrap {
    display: flex;
    align-content: center;
    justify-content: center;
    width: 53px;
}

.pass-match,
.pass-not-match {
    display: inline-block;
    margin: auto;
    font-size: 20px;
    font-weight: bold;
    color: var(--bf-success);
}

.pass-not-match {
    color: var(--danger);
}


.collapsible .signal {
    position: absolute;
    right: 5px;
}

/* Eye positioning in inputs */
.pass-eye-parent {
    position: relative;
}

.pass-eye {
    position: absolute;
    color: var(--bf-grey);
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
    cursor: pointer;
}

.pass-eye-register {
    right: 20px;
}

/*
 * --------------------------------------------------------------------------
 * ALERTS
 * --------------------------------------------------------------------------
 */

#alerts-wrapper {
    position: absolute;
    top: 30px !important;
    right: 1% !important;
    left: auto !important;
    min-width: 20rem !important;
    z-index: 9999;
}

#alerts-wrapper .alert {
    background: var(--bf-white);
    border: 1px solid var(--bf-light-grey);
    opacity: 0.95;
}

#alerts-wrapper .alert-info {
    border-bottom: 3px solid var(--info);
}

#alerts-wrapper .alert-warning {
    border-bottom: 3px solid var(--warning);
}

#alerts-wrapper .alert-danger {
    border-bottom: 3px solid var(--danger);
}

#alerts-wrapper .alert-success {
    border-bottom: 3px solid var(--bf-success);
}

/*#alerts-wrapper button {*/
/*    border: none;*/
/*    background-color: transparent;*/
/*    font-size: 1.5rem;*/
/*    position: absolute;*/
/*    right: 5px;*/
/*}*/

.text-info {
    color: var(--info);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-success {
    color: var(--bf-success);
}

@media (max-width: 767.98px) {
    .ih-auth-theme .form-control,
    .ih-auth-theme .btn-primary,
    .ih-auth-theme .btn-lg,
    .ih-auth-theme .btn-outline-primary {
        min-height: 44px;
    }

    .ih-login-options {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .ih-login-options .btn-primary {
        width: 100%;
    }

    .ih-login-card .card-body,
    .ih-auth-card .card-body {
        padding: 1.25rem;
    }

    #alerts-wrapper {
        left: 0.5rem !important;
        right: 0.5rem !important;
        min-width: 0 !important;
        top: 0.75rem !important;
    }

    .ih-auth-unsplash {
        padding: 0.75rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
}
