/* chat ai 말풍선 */
.messageHuman {
    position:relative; float:right; margin:5px 5px 5px 50px; padding: 10px; width:250px; height:auto;
    color: white; text-align: left; border-radius: 10px; background-color: #9371c0; font-size: 1em; line-height: 1.6em;
}
.messageHuman p {margin-top: 10px; margin-bottom: 10px;}
.messageHuman::after {
    content:""; position: absolute; top: 10px; right: -10px; 
    border-left: 10px solid #9371c0; border-top: 3px solid transparent; border-bottom: 5px solid transparent;
}
.messageAi {
    position:relative; float:right; margin:5px 70px 5px 5px; padding: 10px; width:250px; height:auto; 
    color: white; text-align: left; border-radius: 10px; background-color: #777; font-size: 1em; line-height: 1.6em;
}
.messageAi p {margin-top: 10px; margin-bottom: 10px;}
.messageAi::after {
    content:""; position: absolute; top: 10px; left: -10px; 
    border-right: 10px solid #777; border-top: 3px solid transparent; border-bottom: 5px solid transparent;
}

/* Contact 페이지 — 브랜드 그라데이션(variables-brand) */
.contact-page {
    width: 100%;
    max-width: min(1000px, 100%);
    margin: 80px auto;
    padding: 40px clamp(16px, 4vw, 40px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    min-width: 0;
}

.contact-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    position: relative;
}

.contact-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--gradient-brand);
    border-radius: 2px;
}

.contact-header h1 {
    font-size: 36px;
    color: #2d3e50;
    margin-bottom: 15px;
    justify-content: center;
}

.contact-header h1 .fa {
    color: var(--color-brand-blue, #1e4b8c);
}

.contact-header p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
}

/* 메시지 영역 */
.message-section {
    margin-bottom: 30px;
}

.success-message {
    padding: 20px;
    background: #d4edda;
    border-radius: 8px;
    color: #155724;
    margin: 15px 0;
    font-size: 16px;
    animation: slideIn 0.5s ease-out;
}

.success-message .fa,
.error-message .fa {
    flex-shrink: 0;
}

.error-message {
    padding: 20px;
    background: #f8d7da;
    border-radius: 8px;
    color: #721c24;
    margin: 15px 0;
    font-size: 16px;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 폼 섹션 */
.form-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.form-label {
    font-size: 15px;
    font-weight: 600;
    color: #2d3e50;
}

.form-input,
.form-textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    font-family: inherit;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-brand-blue-bright);
    box-shadow: 0 0 0 3px rgba(45, 123, 199, 0.18);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* 개인정보 처리방침 동의 */
.privacy-agreement {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: var(--color-brand-gold-light);
    border-radius: 8px;
    border: 2px solid var(--color-brand-gold);
}

.privacy-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.privacy-checkbox input[type="checkbox"] {
    display: block !important;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    cursor: pointer;
    accent-color: var(--color-brand-blue-bright);
    appearance: checkbox !important;
    -webkit-appearance: checkbox !important;
    -moz-appearance: checkbox !important;
    border: 2px solid var(--color-brand-blue-bright);
    border-radius: 4px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    opacity: 1;
    visibility: visible;
}

.privacy-checkbox .checkbox-text {
    font-size: 15px;
    color: #333;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.privacy-link {
    color: var(--color-brand-blue-bright);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
    background: white;
    border: 2px solid var(--color-brand-blue-bright);
}

.privacy-link:hover {
    background: #555;
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* 제출 버튼 영역 */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

/* 제출 버튼 */
.submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 18px 50px;
    background: var(--color-brand-blue-bright);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: auto;
    max-width: none;
    margin: 0;
    text-decoration: none;
    box-sizing: border-box;
}

.submit-button-secondary {
    background: #fff;
    color: var(--color-brand-blue-bright);
    border: 2px solid var(--color-brand-blue-bright);
}

.submit-button-secondary:hover {
    background: var(--color-brand-blue-bright);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(45, 123, 199, 0.35);
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(45, 123, 199, 0.35);
    background: var(--color-brand-blue);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 안내 박스 */
.info-box {
    margin-top: 30px;
    padding: 25px;
    background: var(--gradient-brand);
    color: white;
    border-radius: 12px;
    text-align: center;
}

.info-box h3 {
    margin-bottom: 10px;
    font-size: 20px;
}

.info-box p {
    margin: 8px 0;
    font-size: 16px;
}

.info-box a {
    color: white;
    text-decoration: underline;
}

/* 추가 링크 */
.additional-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.link-button {
    padding: 12px 30px;
    background: white;
    color: var(--color-brand-blue-bright);
    border: 2px solid var(--color-brand-blue-bright);
    border-radius: 30px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.link-button:hover {
    background: var(--color-brand-blue-bright);
    color: #fff;
    border-color: var(--color-brand-blue-bright);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 반응형 — 좁은 가로: width 100% + margin 동시 사용 시 가로 스크롤 방지 */
@media (max-width: 768px) {
    .contact-page {
        width: auto;
        max-width: none;
        margin: 40px max(10px, env(safe-area-inset-left, 0px)) 40px max(10px, env(safe-area-inset-right, 0px));
        padding: 28px clamp(12px, 3.5vw, 24px);
    }
    
    .contact-header h1 {
        font-size: 28px;
    }
    
    .form-section {
        padding: clamp(14px, 3vw, 20px);
    }
    
    .privacy-agreement {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: clamp(12px, 3vw, 20px);
    }
    
    .form-actions {
        flex-direction: column;
        width: 100%;
    }

    .form-actions .submit-button {
        width: 100%;
        max-width: 100%;
    }
    
    .additional-links {
        flex-direction: column;
    }
    
    .link-button {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

@media (max-width: 380px) {
    .contact-page {
        margin-top: 24px;
        margin-bottom: 24px;
        margin-left: max(6px, env(safe-area-inset-left, 0px));
        margin-right: max(6px, env(safe-area-inset-right, 0px));
        padding: 20px 10px;
        border-radius: 14px;
    }
    
    .contact-header h1 {
        font-size: 1.5rem;
    }
    
    .contact-header p {
        font-size: 0.9rem;
    }
    
    .form-section {
        padding: 12px 8px;
    }
    
    .form-input,
    .form-textarea {
        padding: 12px 10px;
    }
    
    .privacy-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .link-button {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .messageHuman,
    .messageAi {
        max-width: min(250px, calc(100vw - 32px));
        width: 100%;
        box-sizing: border-box;
    }
}
