/* ==========================================================================
   Form Layout & Validation UI Styles
   - 폼 검증 관련 UI 통합 스타일시트
   - Personal/Company 회원가입 페이지 공통 적용
   - 명함 견적 후가공 옵션 선택 스타일
   ========================================================================== */

/* 후가공 옵션 선택 시 표시 스타일 - 테두리만 적용 */
.naple_select_01.selected {
    border: 1px solid #474747;
    transition: all 0.2s ease;
}

.naple_select_01.selected:focus {
    box-shadow: 0 0 0 2px rgba(255, 183, 100, 0.3);
}

/* 넘버링 input 필드 입력 시 표시 스타일 - 테두리만 적용 */
.naple_input_01.selected,
input[type="text"].selected,
input[type="number"].selected {
    border: 1px solid #474747;
    transition: all 0.2s ease;
}

.naple_input_01.selected:focus,
input[type="text"].selected:focus,
input[type="number"].selected:focus {
    box-shadow: 0 0 0 2px rgba(255, 183, 100, 0.3);
}

/* 넘버링 에러 및 경고 상태 */
.numbering-error {
    border: 2px solid #ff6b6b;
    background-color: #ffe0e0;
    transition: all 0.2s ease;
}

.numbering-warning {
    border: 2px solid #ffa500;
    background-color: #fff3cd;
    transition: all 0.2s ease;
}

/* 게시판 내용 공백 보존 스타일 */
.maple_mypage_add_01_004 {
    white-space: pre-wrap;
    line-height: 1.5;
}

/* 후가공 disabled 상태 통합 스타일 */
#numberingEnd:disabled,
.naple_input_01:disabled[id="numberingEnd"],
input[type="text"]:disabled[id="numberingEnd"] {
    background: transparent;
    color: #4a4a4a;
    font-weight: bold;
    cursor: not-allowed;
    border: 1px solid #d0d0d0;
    text-align: center;
}

/* 후가공 disabled 상태 통합 스타일 - 드롭다운 포함 */
#numbering:disabled,
#rounding:disabled,
#punchSize:disabled,
.naple_select_11:disabled,
.naple_select_06:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border: 1px solid #d0d0d0;
}

/* 툴팁 스타일 통합 */
.production-tooltip,
.numbering-tooltip,
#coating-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 2900;
    pointer-events: none;
}

/* 현대적인 CSS-only 툴팁 */
.modern-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #6c757d;
    font-size: 16px;
    margin-left: 8px;
    transition: color 0.2s ease;
}

.modern-tooltip:hover {
    color: #007bff;
}

.modern-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2900;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    min-width: 200px;
    text-align: center;
    line-height: 1.5;
}

.modern-tooltip::after {
    content: '';
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #667eea;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-tooltip:hover::before,
.modern-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

.modern-tooltip:focus::before,
.modern-tooltip:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .modern-tooltip::before {
        font-size: 12px;
        padding: 10px 14px;
        min-width: 160px;
        bottom: 130%;
    }

    .modern-tooltip::after {
        bottom: 120%;
    }
}

/* 이메일 자동완성 UI - 간결한 버전 (비밀번호 검증과 동일) */
.email-suggestion-box {
    display: none;
    margin-top: 2px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

/* 간결한 이메일 자동완성 표시 */
.email-suggestion-simple {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.suggestion-label {
    font-size: 14px;
    color: #555;
}

.suggestion-value {
    font-size: 14px;
    font-weight: bold;
}

.suggestion-hint {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* 자동완성 전용 스타일 */
.email-suggestion-box.autocomplete-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #bbdefb;
}

.suggestion-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-weight: bold;
    color: #8a6d3b;
}

.suggestion-icon {
    margin-right: 8px;
    font-size: 16px;
}

.suggestion-issues {
    margin-bottom: 12px;
}

.issue-item {
    color: #856404;
    margin-bottom: 4px;
    padding: 4px 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 4px;
}

.suggestion-list {
    margin-bottom: 12px;
}

.suggestion-item {
    padding: 12px;
    margin: 8px 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.suggestion-item:hover {
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.suggestion-text {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-family: monospace;
    font-size: 14px;
}

.original-text {
    color: #dc3545;
    text-decoration: line-through;
    padding: 2px 4px;
    background: #ffebee;
    border-radius: 3px;
}

.arrow {
    margin: 0 8px;
    color: #6c757d;
    font-weight: bold;
}

.suggested-text {
    color: #28a745;
    font-weight: bold;
    padding: 2px 4px;
    background: #e8f5e8;
    border-radius: 3px;
}

.suggestion-reason {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* 자동완성 아이템 스타일 */
.autocomplete-item {
    padding: 12px;
    margin: 8px 0;
    background: white;
    border: 2px solid #2196f3;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.autocomplete-item:hover {
    border-color: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    background: #f3f9ff;
}

.autocomplete-text {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-family: monospace;
    font-size: 14px;
}

.autocomplete-label {
    color: #1976d2;
    font-weight: bold;
    margin-right: 8px;
}

.autocomplete-hint {
    font-size: 12px;
    color: #1976d2;
    font-style: italic;
}

/* 이메일 검증 결과 박스 */
.email-error-box {
    display: none;
    margin-top: -4px;
    margin-bottom: 30px;
    padding: 8px 12px;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    color: #c62828;
    font-size: 13px;
}

.email-success-box {
    display: none;
    margin-top: -4px;
    margin-bottom: 30px;
    padding: 8px 12px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    color: #388e3c;
    font-size: 13px;
}

/* 아이콘 스타일 */
.error-icon,
.success-icon,
.confirm-icon {
    margin-right: 6px;
    font-weight: bold;
    font-size: 13px;
}

/* 이메일 입력창 상태별 스타일 */
.corrected-email {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    background: #e8f5e8;
    animation: correctGlow 2s ease-out;
}

.confirmed-email {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background: #e3f2fd;
    animation: confirmGlow 2s ease-out;
}

@keyframes correctGlow {
    0%, 100% { 
        border-color: #ced4da;
        box-shadow: none;
        background: white;
    }
    50% { 
        border-color: #28a745;
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
        background: #e8f5e8;
    }
}

@keyframes confirmGlow {
    0%, 100% { 
        border-color: #ced4da;
        box-shadow: none;
        background: white;
    }
    50% { 
        border-color: #007bff;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
        background: #e3f2fd;
    }
}

.shake-animation {
    animation: shake 0.6s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* 비밀번호 검증 UI - 간결한 버전 */
.password-validation-box {
    display: none;
    margin-top: -6px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
}

/* 간결한 비밀번호 강도 표시 */
.password-strength-simple {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.strength-label {
    font-size: 14px;
    color: #555;
}

.strength-value {
    font-size: 15px;
    font-weight: bold;
}

.strength-bar-simple {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.validation-hint {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.validation-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-weight: bold;
    color: #1976d2;
}

.validation-icon {
    margin-right: 8px;
    font-size: 16px;
}

.password-strength-container {
    margin-bottom: 12px;
}

.strength-bar-container {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.strength-text {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.validation-issues {
    margin-bottom: 12px;
}

.validation-issue {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    padding: 4px 8px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 4px;
    color: #c62828;
}

.issue-icon {
    margin-right: 8px;
    font-size: 12px;
}

.password-requirements {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.requirement-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.requirement-item.valid {
    background: rgba(76, 175, 80, 0.1);
    color: #388e3c;
}

.requirement-item.invalid {
    background: rgba(244, 67, 54, 0.1);
    color: #c62828;
}

.check-icon {
    margin-right: 6px;
    font-weight: bold;
    font-size: 14px;
}

.requirement-item.valid .check-icon {
    color: #4caf50;
}

.requirement-item.invalid .check-icon {
    color: #f44336;
}

/* 비밀번호 확인 검증 UI */
.password-confirm-validation {
    display: none;
    margin-top: -4px;
    margin-bottom: 30px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.password-confirm-validation.success {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #c8e6c9;
    color: #388e3c;
}

.password-confirm-validation.error {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/* 비밀번호 입력창 상태별 스타일 */
.password-valid {
    border-color: #4caf50;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

.password-invalid {
    border-color: #f44336;
    box-shadow: 0 0 0 0.2rem rgba(244, 67, 54, 0.25);
}

/* 이메일 실시간 검증 메시지 스타일 */
.email-validation {
    margin-top: -10px;
    margin-bottom: 25px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    display: none;
    transition: all 0.3s ease;
}

.email-validation.empty {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    display: none;
}

.email-validation.incomplete {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    display: block;
}

.email-validation.invalid {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.email-validation.valid {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

/* 이메일 입력창 상태별 테두리 색상 */
.email-input.incomplete {
    border-color: #ffeaa7;
}

.email-input.invalid {
    border-color: #f5c6cb;
}

.email-input.valid {
    border-color: #c3e6cb;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .password-requirements {
        grid-template-columns: 1fr;
    }

    .requirement-item {
        font-size: 11px;
    }

    .email-validation {
        font-size: 12px;
        padding: 6px 10px;
    }
}