:root {
    --login-primary: #0f4c81;
    --login-primary-light: #2e7bc0;
    --login-primary-soft: #e8f1fb;
    --login-text: #0e1b2c;
    --login-muted: #647084;
    --login-bg: #f4f6fa;
    --login-border: #e5e9f0;
}

* {
    box-sizing: border-box;
}

.login-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--login-text);
    background: linear-gradient(135deg, #e8f1fb 0%, #f4f6fa 50%, #feede5 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
}

.login-device {
    position: relative;
    width: 390px;
    height: 844px;
    padding: 12px;
    overflow: hidden;
    border-radius: 48px;
    background: #0e1b2c;
    box-shadow:
        0 30px 80px rgba(15, 76, 129, 0.25),
        0 10px 24px rgba(15, 76, 129, 0.12);
}

.login-device::before {
    content: '';
    position: absolute;
    z-index: 10;
    top: 18px;
    left: 50%;
    width: 110px;
    height: 30px;
    border-radius: 18px;
    background: #0e1b2c;
    transform: translateX(-50%);
}

.login-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 36px;
    background: var(--login-bg);
}

.status-bar {
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 28px 6px;
    font-size: 14px;
    font-weight: 700;
}

.status-bar__right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.status-bar__right svg {
    height: 12px;
}

.status-bar__right .status-icon--signal {
    width: 18px;
    fill: currentColor;
}

.status-bar__right .status-icon--battery {
    width: 25px;
}

.status-bar__right .battery-frame,
.status-bar__right .battery-cap {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
}

.status-bar__right .battery-level {
    fill: currentColor;
}

.login-content {
    position: relative;
    min-height: 0;
    flex: 1;
    display: flex;
    align-items: center;
    overflow-y: auto;
    padding: 12px 24px 30px;
    isolation: isolate;
}

.login-content::before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(244, 246, 250, 0.82), rgba(244, 246, 250, 0.68) 48%, rgba(244, 246, 250, 0.9)),
        url('/images/brand/medi-bridge-login-logo.png') center / cover no-repeat,
        var(--login-bg);
    filter: saturate(0.72);
}

.login-toolbar {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 24px;
    display: flex;
    justify-content: flex-end;
}

.login-center {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
    transform: translateY(125px);
}

.language-select {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.language-select::after {
    position: absolute;
    right: 6px;
    color: var(--login-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    content: '▾';
    pointer-events: none;
}

.language-select__value {
    position: absolute;
    left: 6px;
    z-index: 1;
    color: var(--login-primary);
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
}

.language-select select {
    width: 60px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    border: 1px solid #cddff2;
    border-radius: 999px;
    color: transparent;
    background: var(--login-primary-soft);
    appearance: none;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.language-select select option {
    color: #1f2d42;
}

.login-brand {
    padding: 28px 0 22px;
    text-align: center;
}

.login-brand h1 {
    margin: 0;
    color: var(--login-primary);
    font-size: 29px;
    letter-spacing: -0.7px;
}

.login-brand p {
    margin: 7px 0 0;
    color: var(--login-muted);
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 9px;
}

.login-form label {
    margin-top: 3px;
    font-size: 12px;
    font-weight: 750;
}

.login-form input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--login-border);
    border-radius: 13px;
    outline: none;
    background: #fff;
    color: var(--login-text);
    font: inherit;
}

.login-form input:focus {
    border-color: var(--login-primary-light);
    box-shadow: 0 0 0 3px rgba(46, 123, 192, 0.12);
}

.login-form button {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.primary-login-button {
    margin-top: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--login-primary), var(--login-primary-light));
    box-shadow: 0 8px 18px rgba(15, 76, 129, 0.18);
}

.login-form button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 4px;
    color: #8a94a6;
    font-size: 11px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: var(--login-border);
}

.social-login-button {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.social-login-button svg {
    width: 20px;
    height: 20px;
}

.login-form .google-login-button {
    min-height: 42px;
    height: 42px;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #334155;
    background: #fff;
    box-shadow: none;
    font-size: 14px;
    font-weight: 500;
    gap: 8px;
    text-decoration: none;
}

.login-form .kakao-login-button {
    color: #191919;
    background: #fee500;
}

.signup-content::before {
    opacity: 0.28;
}

.signup-center {
    transform: translateY(10px);
}

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

.signup-profile-image {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    border: 3px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 5px 16px rgba(15, 76, 129, 0.16);
}

.signup-form input[readonly] {
    color: var(--login-muted);
    background: rgba(255, 255, 255, 0.76);
}

.signup-note {
    margin: 8px 2px 0;
    color: var(--login-muted);
    font-size: 11px;
    line-height: 1.5;
}

.login-error,
.social-login-error {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    color: #991b1b;
    background: #fee2e2;
    font-size: 12px;
    line-height: 1.5;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px), (hover: none) and (pointer: coarse) {
    .login-body {
        padding: 0;
        background: #0e1b2c;
    }

    .login-device {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: var(--login-bg);
        box-shadow: none;
    }

    .login-device::before,
    .status-bar {
        display: none;
    }

    .login-screen {
        border-radius: 0;
    }
}
