:root {
    --ie-primary: #2EAD6D;
    --ie-primary-hover: #259A5F;
    --ie-primary-soft: #E4F6EC;
    --ie-text-dark: #171a2b;
    --ie-text-muted: #9ca3af;
    --ie-input-border: #e5e7eb;
    --login-page-bg: #F9F9F0;
    --login-btn-top: #A8D86E;
    --login-btn-mid: #6FB84A;
    --login-btn-bottom: #5A9E3A;
    /* 카드 배경 JPG 원본 비율 3072×5504 */
    --login-card-aspect-w: 3072;
    --login-card-aspect-h: 5504;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
}

body.login-page {
    font-family: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
    background: var(--login-page-bg);
    min-height: 100vh;
    min-height: 100dvh;
}

.login-page-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.25rem;
    background: var(--login-page-bg);
}

.login-card {
    position: relative;
    isolation: isolate;
    width: min(
        400px,
        92vw,
        calc(94dvh * var(--login-card-aspect-w) / var(--login-card-aspect-h))
    );
    max-width: 100%;
    aspect-ratio: var(--login-card-aspect-w) / var(--login-card-aspect-h);
    height: auto;
    background-color: #F9F9F0;
    border-radius: 24px;
    padding: clamp(2.25rem, 5vw, 3rem) clamp(1.25rem, 3vw, 1.75rem) clamp(2.5rem, 5vw, 3rem);
    box-shadow: 0 10px 40px rgba(17, 24, 39, 0.07);
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: var(--login-card-bg);
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    pointer-events: none;
}

.login-card > * {
    position: relative;
    z-index: 1;
}

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

.ieum-logo--login {
    display: block;
    width: min(260px, 92%);
    height: auto;
    margin-top: 36px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
}

.login-card form {
    width: 100%;
    max-width: 252px;
    margin-left: auto;
    margin-right: auto;
}

.login-field {
    margin-bottom: 1.1rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--ie-text-dark);
}

.input-with-icon {
    position: relative;
}

.input-with-icon .field-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    pointer-events: none;
    line-height: 1;
}

.login-input {
    width: 100%;
    height: 3.2rem;
    border: 1px solid var(--ie-input-border);
    background-color: transparent;
    border-radius: 12px;
    padding: 0 1rem 0 2.65rem;
    font-size: 0.95rem;
    color: var(--ie-text-dark);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: var(--ie-text-dark) !important;
    caret-color: var(--ie-text-dark);
    background-color: transparent !important;
    transition: background-color 99999s ease-out 0s;
}

.login-input:autofill {
    box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: var(--ie-text-dark) !important;
    background-color: transparent !important;
}

.login-input::placeholder {
    color: var(--ie-text-muted);
    font-weight: 400;
}

.login-input:focus {
    outline: none;
    border-color: var(--ie-primary);
    box-shadow: 0 0 0 3px rgba(46, 173, 109, 0.2);
}

.password-wrap .login-input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #9ca3af;
    font-size: 1.08rem;
    cursor: pointer;
    padding: 0.2rem;
    z-index: 1;
}

.login-options {
    margin: 0.15rem 0 1.5rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #4b5563;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.remember-me input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex-shrink: 0;
    border: 2.5px solid #80B980;
    border-radius: 5px;
    background-color: transparent;
    cursor: pointer;
    vertical-align: middle;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.remember-me input[type="checkbox"]:checked {
    background-color: var(--ie-primary);
    border-color: var(--ie-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2 6.4 11.1 12.5 5' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 0.8rem;
    background-position: center;
    background-repeat: no-repeat;
}

.remember-me input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 173, 109, 0.25);
}

.login-submit {
    width: 100%;
    min-height: 3.55rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(
        180deg,
        var(--login-btn-top) 0%,
        var(--login-btn-mid) 52%,
        var(--login-btn-bottom) 100%
    );
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    box-shadow:
        0 4px 14px rgba(90, 158, 58, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: filter 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.login-submit-text {
    line-height: 1;
}

.login-submit-sparkle {
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    background: no-repeat center / contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M12 2l1.2 4.2L17 7.2l-3.8 1.1L12 12.5 10.8 8.3 7 7.2l3.8-1zM18 11l.8 2.8L21.5 15l-2.7.8L18 18.5l-.8-2.7-2.7-.8 2.7-.8z' fill='%23ffffff' opacity='.95'/%3E%3C/svg%3E");
    transform: translateY(-1px);
}

.login-submit:hover {
    filter: brightness(1.03);
    box-shadow:
        0 6px 18px rgba(90, 158, 58, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.login-submit:active {
    transform: scale(0.992);
    filter: brightness(0.98);
}

.login-error {
    margin: 0 0 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #7f1d1d;
    background: #fef2f2;
}

@media (min-width: 769px) {
    .login-page-wrap {
        padding: 2rem;
    }

    .login-card {
        width: min(
            420px,
            calc(94dvh * var(--login-card-aspect-w) / var(--login-card-aspect-h))
        );
    }

    .login-card form {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    body.login-page,
    .login-page-wrap {
        background: var(--login-page-bg);
    }

    .login-card {
        box-shadow: 0 8px 28px rgba(17, 24, 39, 0.06);
        border-radius: 22px;
    }
}

@media (max-width: 480px) {
    .login-page-wrap {
        padding: 0.85rem;
    }

    .login-card {
        padding: 2rem 1.25rem 2.25rem;
    }

    .ieum-logo--login {
        width: min(270px, 90%);
    }

    .login-card form {
        max-width: 236px;
    }
}
