/* 지원하기 모달 (직접등록글 전용) */

#apply-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10000;
    opacity: 0;
    transition: opacity .2s;
}

#apply-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: var(--bg-primary, #fff);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.15);
    transform: translateY(100%);
    transition: transform .25s cubic-bezier(.32,.72,0,1);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-family: Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* PC: center modal */
@media (min-width: 768px) {
    #apply-sheet {
        bottom: auto;
        left: 50%;
        right: auto;
        top: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        border-radius: 16px;
        max-width: 420px;
        width: 100%;
        max-height: 80vh;
    }
    #apply-sheet.apply-sheet--open {
        transform: translate(-50%, -50%) scale(1) !important;
    }
}

.apply-sheet__handle {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 10px auto 0;
}

@media (min-width: 768px) {
    .apply-sheet__handle { display: none; }
}

.apply-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.apply-sheet__title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.apply-sheet__close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.apply-sheet__body {
    padding: 20px;
}

.apply-field {
    margin-bottom: 18px;
}

.apply-field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

/* Gender chips */
.apply-chips {
    display: flex;
    gap: 10px;
}

.apply-chip {
    flex: 1;
    padding: 10px 0;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}

.apply-chip.selected {
    border-color: #3B82F6;
    background: #EFF6FF;
    color: #3B82F6;
}

/* Input & Select */
.apply-input,
.apply-select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #1a1a1a;
    background: #fff;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.apply-input:focus,
.apply-select:focus {
    border-color: #3B82F6;
}

.apply-input::placeholder {
    color: #bbb;
}

.apply-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Phone verify */
.apply-phone-row {
    display: flex;
    gap: 8px;
}
.apply-phone-row .apply-input {
    flex: 1;
}
.apply-phone-verify-btn {
    flex-shrink: 0;
    padding: 0 14px;
    background: #fff;
    color: #3B82F6;
    border: 1.5px solid #3B82F6;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
    min-height: 44px;
    white-space: nowrap;
}
.apply-phone-verify-btn:hover:not(:disabled) {
    background: #EFF6FF;
}
.apply-phone-verify-btn:disabled {
    background: #DCFCE7;
    color: #16A34A;
    border-color: #16A34A;
    cursor: default;
    opacity: 1;
}
.apply-phone-code-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.apply-phone-code-row .apply-input {
    flex: 1;
    letter-spacing: 2px;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
}
.apply-phone-msg {
    font-size: 12px;
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 6px;
}
.apply-phone-msg--error {
    background: #FEE2E2;
    color: #DC2626;
}
.apply-phone-msg--success {
    background: #DCFCE7;
    color: #16A34A;
}
.apply-phone-msg--info {
    background: #EFF6FF;
    color: #3B82F6;
}
.apply-phone-verified {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #16A34A;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}

/* Consent */
.apply-consent {
    margin: 14px 0 16px;
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}
.apply-consent__label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    min-height: 28px;
}
.apply-consent__cb {
    width: 18px;
    height: 18px;
    accent-color: #3B82F6;
    flex-shrink: 0;
    cursor: pointer;
}
.apply-consent__text {
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.4;
}
.apply-consent__text strong {
    color: #DC2626;
    font-weight: 700;
    margin-right: 2px;
}
.apply-consent__details {
    margin-top: 8px;
    font-size: 13px;
}
.apply-consent__details summary {
    color: #3B82F6;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    padding: 4px 0;
}
.apply-consent__details summary:hover {
    text-decoration: underline;
}
.apply-consent__content {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: #555;
    line-height: 1.6;
}
.apply-consent__content p {
    margin: 0 0 4px;
}

/* Submit button */
.apply-submit {
    width: 100%;
    padding: 14px;
    background: #3B82F6;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
    margin-top: 6px;
}

.apply-submit:hover {
    background: #2563EB;
}

.apply-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.apply-submit .fa-spinner {
    margin-right: 6px;
}

/* Toast */
.apply-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10010;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
}

.apply-toast.show {
    opacity: 1;
}

/* Applicant badge on view.php */
.kw-applicant-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #EFF6FF;
    color: #3B82F6;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
    cursor: pointer;
}

.kw-applicant-badge:hover {
    background: #DBEAFE;
}

.kw-applicant-badge i {
    font-size: 12px;
}
