/* ==========================================================================
   lso_signup.css — 전문가 입점 신청 페이지 전용 스타일
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Noto Sans KR', sans-serif; }

/* Scoped containment — prevents any child from escaping the signup container */
.signup-container * {
    box-sizing: border-box;
    max-width: 100%;
}

body { background-color: #f4f7f6; color: #333; line-height: 1.6; }

/* ---------- Header ---------- */
.signup-header {
    background: #00605d;
    padding: 20px 0;
    text-align: center;
}
.signup-header h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}
.signup-header p { color: #b5dbd9; font-size: 14px; word-break: keep-all; padding: 0 10px; }

/* ---------- Container ---------- */
.signup-container { max-width: 860px; margin: 40px auto 80px; padding: 0 20px; }

/* ---------- Auth screen (step 1) ---------- */
.auth-screen {
    text-align: center;
    background: #fff;
    padding: 80px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-top: 60px;
}
.auth-screen h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a2b4c;
    margin-bottom: 10px;
    word-break: keep-all;
}
.auth-screen p { font-size: 16px; color: #666; margin-bottom: 40px; line-height: 1.5; word-break: keep-all; }

.btn-auth {
    background: #007672;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    padding: 18px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 4px 12px rgba(0,118,114,0.3);
    width: 100%;
    max-width: 450px;
    white-space: nowrap;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}
.btn-auth:hover { background: #00605d; }

.auth-footer { margin-top: 25px; font-size: 14px; color: #888; word-break: keep-all; }
.auth-footer a { color: #007672; text-decoration: underline; font-weight: 500; white-space: nowrap; }

/* ---------- OTP phone/code input rows ---------- */
.otp-phone-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.otp-prefix { font-size: 18px; font-weight: 700; color: #333; }
.otp-dash   { font-size: 18px; color: #aaa; font-weight: 700; }
.otp-input-seg {
    width: 90px;
    text-align: center;
    padding: 12px 8px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 4px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.otp-input-seg:focus { outline: none; border-color: #007672; }

/* Split phone input — phoneMiddle / phoneLast */
.phone-input-wrap { width: 100%; }
.phone-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}
.phone-static {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}
.phone-dash {
    font-size: 18px;
    color: #94a3b8;
    font-weight: 700;
}
.phone-box {
    width: 90px;
    height: 48px;
    text-align: center;
    font-size: 18px;
    letter-spacing: 3px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #1e293b;
    outline: none;
    cursor: text;
    /* Ensure pointer events are not blocked */
    pointer-events: auto;
    -webkit-user-select: text;
    user-select: text;
}
.phone-box:focus {
    border-color: #1b9e75;
    box-shadow: 0 0 0 3px rgba(27, 158, 117, 0.15);
}
.phone-hint {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}
/* Send OTP button — same visual as btn-otp-send but scoped to this step */
.btn-send-otp {
    display: block;
    margin: 12px auto 0;
    background: #007672;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-send-otp:hover    { background: #00605d; }
.btn-send-otp:disabled { background: #aaa; cursor: not-allowed; }
.btn-otp-send {
    background: #007672;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background 0.2s;
}
.btn-otp-send:hover { background: #00605d; }
.otp-verify-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}
.otp-code-input {
    width: 210px;
    text-align: center;
    padding: 14px 10px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 8px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.otp-code-input:focus { outline: none; border-color: #007672; }
.otp-meta-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    margin-bottom: 8px;
}
.otp-timer { font-weight: 700; color: #e74c3c; min-width: 40px; }
.btn-resend {
    background: none;
    border: none;
    color: #007672;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    padding: 0;
}
.btn-resend:disabled { color: #bbb; text-decoration: none; cursor: not-allowed; }
.otp-success {
    font-size: 18px;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.otp-masked-phone { font-size: 14px; color: #555; font-weight: 500; letter-spacing: 1px; }

/* ---------- OTP step containers ---------- */
.otp-wrap {
    text-align: center;
    background: #fff;
    padding: 60px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    margin-top: 60px;
}
.otp-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a2b4c;
    margin-bottom: 28px;
    line-height: 1.45;
    word-break: keep-all;
}
.otp-phone-display {
    font-size: 15px;
    color: #555;
    margin-bottom: 18px;
    font-weight: 500;
}
.otp-timer-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 18px;
    font-size: 14px;
}
.btn-otp-primary {
    display: block;
    margin: 16px auto 0;
    background: #007672;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    max-width: 340px;
}
.btn-otp-primary:hover    { background: #00605d; }
.btn-otp-primary:disabled { background: #aaa; cursor: not-allowed; }
.login-link {
    margin-top: 24px;
    font-size: 14px;
    color: #888;
    word-break: keep-all;
}
.login-link a { color: #007672; text-decoration: underline; font-weight: 500; }

/* ---------- Main form screen (step 2) ---------- */
.main-form-screen { display: none; }

/* ---------- Form sections ---------- */
.form-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    padding: 40px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a2b4c;
    border-bottom: 2px solid #1a2b4c;
    padding-bottom: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.req-guide { font-size: 13px; color: #e74c3c; font-weight: 400; }

.section-desc { font-size: 14px; color: #666; margin-bottom: 25px; }

/* ---------- Form rows and groups ---------- */
.form-row { display: flex; margin-bottom: 25px; flex-wrap: wrap; }

.form-group { flex: 1; min-width: 0; margin-right: 20px; }
.form-group:last-child { margin-right: 0; }
.form-group.full { flex: 0 0 100%; margin-right: 0; }

label { display: block; font-size: 14px; font-weight: 700; color: #444; margin-bottom: 8px; }
.req  { color: #e74c3c; margin-left: 4px; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
    width: 100%; padding: 14px 16px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 15px; color: #333; background: #fff; transition: all 0.2s;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: #007672; outline: none; box-shadow: 0 0 0 3px rgba(0,118,114,0.1);
}

input.readonly-auth, select.readonly-auth {
    background-color: #f0f4f4;
    color: #007672;
    font-weight: 700;
    border-color: #d1e2e2;
    pointer-events: none;
}

textarea { height: 120px; resize: vertical; }
.help-text { font-size: 13px; color: #888; margin-top: 6px; display: block; }

/* ---------- Char counter ---------- */
.char-counter { font-size: 12px; color: #888; text-align: right; margin-top: 4px; }
.char-counter.limit-reached { color: #e74c3c; font-weight: bold; }

/* ---------- File upload ---------- */
.file-upload-wrap { display: flex; gap: 10px; align-items: center; }
.file-upload-wrap input[type="text"] { flex: 1; background: #f9f9f9; cursor: not-allowed; }
.file-upload-wrap input[type="file"] { display: none; }

.btn-file, .btn-postcode {
    padding: 14px 20px;
    background: #ecefef;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #555;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s;
    display: inline-block;
    text-align: center;
    font-family: inherit;
}
.btn-file:hover, .btn-postcode:hover { background: #e1e5e5; }
.btn-postcode { padding: 14px 15px; }

/* ---------- Birth + gender row ---------- */
.birth-gender-wrap { display: flex; gap: 10px; }
.birth-gender-wrap input { flex: 2; }
.birth-gender-wrap select { flex: 1; }

/* ---------- Address wrap ---------- */
.postcode-wrap { display: flex; gap: 10px; margin-bottom: 10px; max-width: 300px; }

/* ---------- Expertise area ---------- */
.expertise-box {
    background: #f9fbfc;
    border: 1px solid #e1e8e5;
    border-radius: 8px;
    padding: 25px;
    margin-top: 10px;
}
.main-expertise { margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px dashed #ccc; }
.main-expertise select { width: 100%; max-width: 300px; padding: 12px; font-weight: 500; border-color: #007672; background-color: #fff; }

.sub-expertise .sub-title {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
    color: #444;
    margin-bottom: 15px;
}

.expertise-category {
    margin-bottom: 20px;
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #eee;
}
.expertise-category:last-child { margin-bottom: 0; }
.cat-title { font-size: 14px; font-weight: 700; color: #007672; margin-bottom: 12px; border-bottom: 1px solid #f0f0f0; padding-bottom: 8px; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.checkbox-label { display: flex; align-items: center; font-size: 14px; color: #555; cursor: pointer; transition: 0.2s; line-height: 1.3; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; margin-right: 8px; accent-color: #007672; flex-shrink: 0; }
.checkbox-label.disabled { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }

/* ---------- Settlement account ---------- */
.tax-bank-wrap {
    background: #fdfdfd;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}
.tax-bank-title {
    font-size: 15px;
    font-weight: 700;
    color: #007672;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.tax-bank-title::before { content: '✔️'; margin-right: 6px; font-size: 13px; }

/* ---------- Submit area ---------- */
.submit-wrap { text-align: center; margin-top: 50px; padding-bottom: 50px; }
.btn-submit {
    background: #007672;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    padding: 18px 80px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 4px 12px rgba(0,118,114,0.3);
    font-family: inherit;
}
.btn-submit:hover { background: #00605d; }

.career-calc-text { font-size: 15px; font-weight: 700; color: #007672; display: flex; align-items: center; }

/* ---------- Join path other input ---------- */
.join-path-other { display: none; max-width: 400px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .signup-header h1 { font-size: 21px; }
    .signup-header p  { font-size: 13px; }
    .form-section     { padding: 25px 15px; }
    .form-row         { flex-direction: column; margin-bottom: 0; }
    .form-group       { margin-right: 0; margin-bottom: 20px; }
    .checkbox-grid    { grid-template-columns: 1fr 1fr; }
    .career-calc-text { margin-top: 10px; }
    .postcode-wrap    { flex-direction: column; max-width: 100%; }

    .auth-screen                { padding: 40px 15px; margin-top: 20px; }
    .auth-screen h2             { font-size: 20px; line-height: 1.4; }
    .auth-screen p              { font-size: 14px; }
    .btn-auth                   { font-size: 16px; padding: 15px 10px; width: 100%; }
    input::placeholder,
    textarea::placeholder       { font-size: 13px; letter-spacing: -0.5px; }
}

@media (max-width: 380px) {
    .signup-header h1 { font-size: 19px; }
    .signup-header p  { font-size: 12px; padding: 0 5px; }
    .auth-screen      { padding: 40px 10px; }
    .auth-screen h2   { font-size: 18px; }
    .auth-screen p    { font-size: 13px; }
    .btn-auth         { font-size: 15px; padding: 15px 5px; }
    .auth-footer      { font-size: 13px; }

    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="url"],
    select              { padding: 12px 10px; }
    input::placeholder,
    textarea::placeholder { font-size: 12px; letter-spacing: -0.8px; }
}

/* ---------- CS center button (pre-login contact link) ---------- */
.btn-cs-center {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 8px;
}
.btn-cs-center:hover {
    border-color: #1b9e75;
    color: #1b9e75;
    background: #f0fdf4;
}
.btn-cs-center i {
    font-size: 14px;
}

/* ---------- Mobile layout — stack and contain all form elements ---------- */
@media (max-width: 600px) {

    /* Stack form rows vertically */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-group {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
    }
    .form-group.full {
        width: 100%;
    }

    /* All inputs and selects: fill container */
    select,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="url"] {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Birth + gender: stack vertically */
    .birth-gender-wrap {
        flex-direction: column;
        gap: 8px;
    }
    .birth-gender-wrap input,
    .birth-gender-wrap select {
        flex: none;
        width: 100%;
    }

    /* Postcode wrap: stack and fill */
    .postcode-wrap {
        flex-direction: column;
        max-width: 100%;
    }
    .postcode-wrap input,
    .postcode-wrap button {
        width: 100%;
    }

    /* Career year selector */
    #careerStartYear {
        max-width: 100% !important;
        width: 100% !important;
    }
    .career-calc-text {
        margin-top: 8px;
    }

    /* Named select overrides */
    #jobSelect,
    #joinPath,
    #lawSchoolSelect {
        max-width: 100% !important;
    }
    .join-path-other {
        max-width: 100% !important;
    }

    /* Main expertise select */
    .main-expertise select {
        max-width: 100% !important;
    }

    /* Checkbox grid: 2 columns */
    .checkbox-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* File upload: stack */
    .file-upload-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .file-upload-wrap input[type="text"] {
        width: 100%;
    }
    .btn-file {
        width: 100%;
        text-align: center;
    }

    /* Submit button: full width */
    .btn-submit {
        width: 100%;
        padding: 16px;
    }

    /* Dynamic exam fields generated by renderDynamicExamFields() */
    #dynamicExamFields .form-row > div {
        width: 100% !important;
        min-width: 0 !important;
    }
    #dynamicExamFields select,
    #dynamicExamFields input {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* OTP and form section padding */
    .otp-wrap    { padding: 40px 20px; }
    .form-section { padding: 20px 16px; }
}
