*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Pretendard', -apple-system, sans-serif;
    background: #eef1f6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    display: flex;
    width: 820px;
    min-height: 560px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.13);
    background: #fff;
}

/* ── 좌측 패널 ── */
.left {
    width: 340px;
    flex-shrink: 0;
    background: #1e2d4d;
    padding: 48px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
}
.logo span { color: #5ba3f5; }

.left-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.left-desc {
    font-size: 12.5px;
    color: #a8bcdb;
    line-height: 1.7;
    margin-bottom: 32px;
}

.feature-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #c8d9ef;
}
.feature-list li i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(91,163,245,0.25);
    color: #5ba3f5;
    font-size: 11px;
    flex-shrink: 0;
}

/* ── 우측 패널 ── */
.right {
    flex: 1;
    padding: 44px 44px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-title { font-size: 22px; font-weight: 700; color: #1a2540; margin-bottom: 4px; }
.form-sub   { font-size: 13px; color: #8a93a8; margin-bottom: 28px; }

/* 2열 그리드 */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #3d4d6b;
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-wrap .ic {
    position: absolute;
    left: 11px;
    color: #aab3c6;
    font-size: 14px;
    pointer-events: none;
}
.input-wrap input,
.input-wrap select {
    width: 100%;
    height: 40px;
    border: 1px solid #dde2ed;
    border-radius: 7px;
    font-family: inherit;
    font-size: 13.5px;
    color: #2c3a56;
    background: #f8fafd;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.input-wrap input  { padding: 0 12px 0 34px; }
.input-wrap select { padding: 0 12px 0 34px; appearance: none; cursor: pointer; }
.input-wrap input:focus,
.input-wrap select:focus {
    border-color: #3b6ac9;
    box-shadow: 0 0 0 3px rgba(59,106,201,0.1);
    background: #fff;
}

/* 구매사코드 — Buyer 전용 안내 뱃지 */
.field-comp-code label {
    display: flex;
    align-items: center;
    gap: 6px;
}
.badge-buyer {
    font-size: 10px;
    font-weight: 600;
    color: #3b6ac9;
    background: #e8eefb;
    border-radius: 4px;
    padding: 1px 6px;
    letter-spacing: 0.2px;
}

/* 구매사코드 비활성(Supplier일 때) */
.input-wrap input:disabled,
.input-wrap select:disabled {
    background: #f0f2f7;
    color: #b0b8cc;
    cursor: not-allowed;
    border-color: #e4e8f0;
}

/* 아이디 저장 */
.check-row {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    font-size: 13px;
    color: #4a5570;
}
.check-row input[type=checkbox] {
    width: 15px; height: 15px;
    accent-color: #3b6ac9;
    cursor: pointer;
}

/* 로그인 버튼 */
.btn-login {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: #1e2d4d;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .18s;
    margin-bottom: 18px;
}
.btn-login:hover { background: #2a3f6e; }

/* 링크 행 */
.link-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}
.link-row a {
    font-size: 12.5px;
    color: #3b6ac9;
    text-decoration: none;
}
.link-row a:hover { text-decoration: underline; }

/* 하단 버튼 행 */
.btn-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.btn-outline {
    height: 38px;
    border: 1px solid #dde2ed;
    border-radius: 7px;
    background: #fff;
    font-family: inherit;
    font-size: 12.5px;
    color: #3d4d6b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .15s, border-color .15s;
}
.btn-outline:hover { background: #f3f6fb; border-color: #b0bcd8; }

/* select arrow */
.arrow {
    position: absolute;
    right: 10px;
    pointer-events: none;
    color: #8a93a8;
    font-size: 11px;
}

.hidden {
    display: none;
}

/* 모달 스타일 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(27, 42, 74, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(27, 42, 74, 0.2);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1E293B;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #94A3B8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #EF4444;
}

.modal-body {
    padding: 20px 24px 24px;
}

.modal-body .field {
    margin-bottom: 16px;
}

.modal-body .field:last-of-type {
    margin-bottom: 20px;
}

.btn-find {
    width: 100%;
    padding: 12px;
    background: #1e2d4d;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-find:hover {
    background: #2a3f6e;
    box-shadow: 0 4px 12px rgba(27, 42, 74, 0.3);
}

.btn-find:disabled {
    background: #CBD5E1;
    cursor: not-allowed;
    box-shadow: none;
}

.find-result {
    margin-top: 16px;
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.find-result.success {
    display: block;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
}

.find-result.success .result-title {
    color: #166534;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.find-result.success .result-id {
    font-size: 18px;
    font-weight: 700;
    color: #15803D;
}

.find-result.error {
    display: block;
    background: #FEF2F2;
    border: 1px solid #FECACA;
}

.find-result.error .result-title {
    color: #991B1B;
    font-weight: 600;
    font-size: 13px;
}

/* 반응형 */
@media (max-width: 860px) {
    .card {
        flex-direction: column;
        width: 100%;
        max-width: 480px;
        margin: 20px;
    }

    .left {
        width: 100%;
        padding: 36px;
        min-height: auto;
    }

    .logo {
        font-size: 28px;
    }

    .feature-list {
        display: none;
    }

    .right {
        padding: 36px;
    }
}

@media (max-width: 576px) {
    .card {
        margin: 10px;
        border-radius: 12px;
    }

    .left {
        padding: 28px;
    }

    .right {
        padding: 28px;
    }

    .row-2 {
        grid-template-columns: 1fr;
    }

    .btn-row {
        grid-template-columns: 1fr;
    }
}
