:root {
    --pacs-primary: #0066FF;
    --pacs-primary-light: #1E88E5;
    --pacs-text: #1A2B48;
    --pacs-text-muted: #667085;
    --pacs-accent: #F08C2D;
    --pacs-surface: #FFFFFF;
    --pacs-bg: #F5F8FC;
    --pacs-border: #D7E0EA;
}

body.bg-gradient-primary {
    background: var(--pacs-bg) !important;
}

.pacs-login {
    position: relative;
    min-height: 100vh;
    font-family: "Segoe UI", Inter, Roboto, Arial, sans-serif;
    color: var(--pacs-text);
    overflow-x: hidden;
}

.pacs-login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(135deg, #f8fbff 0%, #eef4fb 50%, #f5f8fc 100%);
}

.pacs-login-bg-hex {
    position: absolute;
    inset: 0;
    opacity: .45;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cg fill='none' stroke='%23c5d5ea' stroke-width='1'%3E%3Cpath d='M28 1l27 15v30l-27 15L1 46V16z'/%3E%3Cpath d='M28 51l27 15v30l-27 15L1 96V66z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 56px 100px;
}

.pacs-login-bg-monitor {
    position: absolute;
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
    width: min(520px, 42vw);
    height: min(380px, 32vw);
    background: url('/img/mri-bg.jpg') center/cover no-repeat;
    border-radius: 16px;
    filter: blur(2px);
    opacity: .22;
}

.pacs-login-wrap {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pacs-login-lang {
    position: absolute;
    top: 24px;
    right: 32px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .92);
    border: 1px solid var(--pacs-border);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(26, 43, 72, .06);
}

.pacs-login-lang-globe,
.pacs-login-lang-chevron {
    width: 18px;
    height: 18px;
    stroke: var(--pacs-primary-light);
    fill: none;
    stroke-width: 1.8;
    flex-shrink: 0;
}

.pacs-login-lang-chevron {
    pointer-events: none;
}

.pacs-login-lang-select {
    border: none;
    background: transparent;
    font-size: .92rem;
    font-weight: 600;
    color: var(--pacs-text);
    cursor: pointer;
    outline: none;
    appearance: none;
    padding: 0 2px;
    max-width: 180px;
}

.pacs-login-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(32px, 6vw, 96px);
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 32px 24px;
    width: 100%;
}

.pacs-login-left {
    flex: 1 1 420px;
    max-width: 480px;
}

.pacs-login-logo {
    max-width: 320px;
    width: 100%;
}

.pacs-login-divider {
    width: 72px;
    height: 4px;
    background: var(--pacs-accent);
    border-radius: 2px;
    margin: 28px 0 32px;
}

.pacs-login-feature {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.pacs-login-feature-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(26, 43, 72, .08);
}

.pacs-login-feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--pacs-primary-light);
    fill: none;
    stroke-width: 1.8;
}

.pacs-login-feature h5 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pacs-text);
}

.pacs-login-feature p {
    margin: 0;
    font-size: .92rem;
    color: var(--pacs-text-muted);
    line-height: 1.45;
}

.pacs-login-card {
    flex: 0 1 480px;
    width: 100%;
    max-width: 480px;
    background: var(--pacs-surface);
    border-radius: 28px;
    box-shadow: 0 24px 64px rgba(26, 43, 72, .12);
    padding: 40px 40px 28px;
}

.pacs-login-card h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--pacs-text);
    line-height: 1.2;
}

.pacs-login-subtitle {
    margin: 0 0 28px;
    color: var(--pacs-text-muted);
    font-size: .95rem;
    line-height: 1.5;
}

.pacs-login-field {
    margin-bottom: 20px;
}

.pacs-login-field label {
    display: block;
    margin-bottom: 8px;
    font-size: .92rem;
    font-weight: 600;
    color: var(--pacs-primary-light);
}

.pacs-login-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1.5px solid var(--pacs-border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.pacs-login-input-wrap:focus-within {
    border-color: var(--pacs-primary);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, .12);
}

.pacs-login-input-wrap.is-invalid {
    border-color: #dc3545;
}

.pacs-login-input-wrap svg {
    width: 20px;
    height: 20px;
    stroke: var(--pacs-primary-light);
    fill: none;
    stroke-width: 1.8;
    flex-shrink: 0;
}

.pacs-login-input-inner {
    flex: 1;
    min-width: 0;
}

.pacs-login-input-wrap input {
    border: none !important;
    box-shadow: none !important;
    outline: none;
    width: 100%;
    font-size: .95rem;
    background: transparent;
    padding: 0;
    color: var(--pacs-text);
}

.pacs-login-input-wrap input::placeholder {
    color: #98a2b3;
}

.pacs-login-input-wrap .invalid-feedback {
    display: block;
    margin-top: 6px;
    font-size: .85rem;
}

.pacs-login-eye {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    line-height: 0;
    flex-shrink: 0;
}

.pacs-login-eye svg {
    stroke: #98a2b3;
}

.pacs-login-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #1E88E5 0%, #0066FF 100%);
    box-shadow: 0 8px 24px rgba(0, 102, 255, .28);
    transition: filter .2s, box-shadow .2s;
}

.pacs-login-submit svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
}

.pacs-login-submit:hover {
    filter: brightness(1.05);
    box-shadow: 0 10px 28px rgba(0, 102, 255, .34);
}

.pacs-login-footer {
    position: relative;
    z-index: 1;
    padding: 16px 24px 24px;
    text-align: center;
    color: var(--pacs-text-muted);
    font-size: .85rem;
}

.pacs-login-footer small {
    font-size: inherit;
}

@media (max-width: 991px) {
    .pacs-login-lang {
        top: 16px;
        right: 16px;
        max-width: calc(100% - 32px);
    }

    .pacs-login-left {
        display: none;
    }

    .pacs-login-content {
        flex-direction: column;
        align-items: stretch;
        padding: 72px 20px 16px;
    }

    .pacs-login-card {
        flex: none;
        max-width: none;
        padding: 28px 24px 22px;
    }

    .pacs-login-bg-monitor {
        left: 50%;
        top: 30%;
        transform: translate(-50%, -50%);
        width: 80vw;
        height: 50vw;
        opacity: .12;
    }
}
