/* Junction admin login — shared styles */

:root {
    --login-primary: #2e6ea3;
    --login-primary-hover: #275f8c;
    --login-text: #4b5563;
    --login-muted: #9ca3af;
    --login-border: #d1d5db;
    --login-card-border: #e5e7eb;
    --login-bg: #e3eaf0;
    --login-surface: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body.login-page {
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--login-text);
    background-color: var(--login-bg);
    background-image: url("login-bg.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    -webkit-font-smoothing: antialiased;
}

.login-box {
    width: 100%;
    max-width: 450px;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-brand {
    text-align: center;
    margin-bottom: 1.35rem;
}

.login-brand-icon {
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 0.85rem;
}

.login-brand-name {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--login-primary);
    line-height: 1;
}

.login-card {
    width: 100%;
    border: 1px solid var(--login-card-border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.1);
    background: var(--login-surface);
    overflow: hidden;
}

.login-card .card-body {
    padding: 1.75rem 1.65rem 1.65rem;
    background: var(--login-surface);
}

.login-subtitle {
    text-align: center;
    color: var(--login-text);
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0 0 1.35rem;
}

.login-form .login-field {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    border: 1px solid var(--login-border);
    border-radius: 6px;
    background: var(--login-surface);
    min-height: 50px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-form .login-field:focus-within {
    border-color: #93c5e5;
    box-shadow: 0 0 0 0.2rem rgba(46, 110, 163, 0.14);
}

.login-field-icon {
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--login-text);
    font-size: 0.95rem;
}

.login-field-divider {
    width: 1px;
    height: 28px;
    background: var(--login-card-border);
    flex-shrink: 0;
}

.login-page .login-form .form-control {
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0;
    padding: 0.75rem 0.9rem;
    color: #1f2937;
    font-size: 0.95rem;
    height: auto;
    min-height: 48px;
}

.login-page .login-form .form-control::placeholder {
    color: var(--login-muted);
    opacity: 1;
}

.login-page .login-form .form-control:focus {
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: none;
}

.login-field--password .form-control {
    padding-right: 0.35rem;
}

.login-password-toggle {
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--login-text);
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
}

.login-password-toggle:hover,
.login-password-toggle:focus {
    color: var(--login-primary);
    outline: none;
}

.login-password-toggle:focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: -2px;
}

.login-remember {
    display: flex;
    align-items: center;
    margin: 0.15rem 0 1rem;
}

.login-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    color: var(--login-text);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.login-remember-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--login-primary);
    cursor: pointer;
}

.login-submit {
    display: block;
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.8rem 1rem;
    min-height: 50px;
    border: 0;
    border-radius: 6px;
    background: var(--login-primary) !important;
    color: #fff !important;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.login-submit:hover,
.login-submit:focus {
    background: var(--login-primary-hover) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(46, 110, 163, 0.28);
}

.login-submit:focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: 2px;
}

.login-page .alert {
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Tablet */
@media (max-width: 992px) {
    .login-box {
        max-width: 420px;
        padding: 1.5rem 1.5rem;
    }

    .login-brand-name {
        font-size: 1.7rem;
    }

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

/* Mobile / small tablet */
@media (max-width: 768px) {
    body.login-page {
        align-items: flex-start;
        background-position: center top;
        padding: 0;
    }

    .login-box {
        max-width: 100%;
        width: 100%;
        padding: 2.5rem 1.25rem 2rem;
        min-height: 100vh;
        min-height: 100dvh;
        justify-content: center;
    }

    .login-brand {
        margin-bottom: 1.15rem;
    }

    .login-brand-icon {
        width: 52px;
        height: 52px;
    }

    .login-brand-name {
        font-size: 1.55rem;
        letter-spacing: 0.05em;
    }

    .login-card {
        border-radius: 12px;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
    }

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

    .login-subtitle {
        font-size: 1rem;
        margin-bottom: 1.2rem;
    }

    .login-form .login-field {
        min-height: 48px;
        margin-bottom: 0.9rem;
    }

    .login-submit {
        min-height: 48px;
        font-size: 1rem;
    }
}

/* Phones */
@media (max-width: 480px) {
    .login-box {
        padding: 2rem 1rem 1.5rem;
    }

    .login-brand-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 0.7rem;
    }

    .login-brand-name {
        font-size: 1.4rem;
    }

    .login-card .card-body {
        padding: 1.35rem 1rem 1.2rem;
    }

    .login-field-icon {
        flex-basis: 40px;
        font-size: 0.9rem;
    }

    .login-page .login-form .form-control {
        font-size: 0.92rem;
        padding: 0.7rem 0.75rem;
        min-height: 46px;
    }

    .login-subtitle {
        font-size: 0.95rem;
    }
}

/* Short viewports (landscape phones) */
@media (max-height: 560px) and (orientation: landscape) {
    body.login-page {
        align-items: flex-start;
        overflow-y: auto;
    }

    .login-box {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
        min-height: auto;
    }

    .login-brand {
        margin-bottom: 0.85rem;
    }

    .login-brand-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 0.5rem;
    }

    .login-brand-name {
        font-size: 1.35rem;
    }

    .login-card .card-body {
        padding: 1.15rem 1.25rem 1.15rem;
    }

    .login-subtitle {
        margin-bottom: 0.9rem;
    }

    .login-form .login-field {
        margin-bottom: 0.7rem;
        min-height: 44px;
    }

    .login-submit {
        min-height: 44px;
    }
}
