/* ===== 미니멀 디자인 시스템 - 법률사무소 信 ===== */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* 로고 전용 폰트 */
@font-face {
    font-family: 'MaruBuri';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-10-21@1.0/MaruBuri-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ===== CSS 변수 ===== */
:root {
    --color-bg-page: #F8FAFC;
    --color-bg-card: #FFFFFF;

    --color-primary: #0F172A;
    --color-secondary: #64748B;
    --color-accent: #2563EB;
    --color-accent-hover: #1D4ED8;
    --color-success: #059669;
    --color-danger: #DC2626;

    --color-border: #E2E8F0;
    --color-border-strong: #CBD5E1;
    --color-input-bg: #F8FAFC;
    --color-input-border: #CBD5E1;
    --color-placeholder: #94A3B8;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.15s ease;
}

/* ===== 기본 리셋 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-bg-page);
    color: var(--color-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ===== 아이콘 색상 ===== */
.fas,
.fab {
    color: var(--color-secondary);
}

h2 .fas,
h3 .fas {
    color: var(--color-primary);
}

.btn .fas {
    color: inherit;
}

/* ===== 信 서예체 ===== */
.hanja-shin {
    font-family: 'Zhi Mang Xing', cursive !important;
    font-size: 1.5em !important;
    font-weight: 400 !important;
    display: inline-block;
    margin: 0 0.05em;
    line-height: 1;
    vertical-align: baseline;
    color: inherit !important;
    position: relative;
    top: 0.06em;
}

.header-left .hanja-shin {
    font-size: 1.35em !important;
    top: 0.04em;
}

/* ===== 헤더 (다크 네이비) ===== */
.header {
    background: var(--color-primary);
    border-bottom: none;
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
}

.header-left {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    text-decoration: none;
    transition: var(--transition);
    padding: 0.4rem;
    margin: -0.4rem;
    border-radius: var(--radius-sm);
}

.header-left:hover {
    background: rgba(255, 255, 255, 0.08);
}

.header-left .main-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.header-left strong {
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.9rem;
}

.header-left .website-info {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.header-left .website-info i {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
}

.browser-tip {
    color: #FFFFFF;
    font-size: 0.95rem;
    background: transparent;
    padding: 0.5rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
}

.browser-tip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

.browser-tip .fas {
    color: #FFFFFF;
}

/* ===== 메인 컨텐츠 ===== */
.main-content {
    flex: 1;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

/* ===== 페이지 헤더 (미니멀) ===== */
.page-header {
    text-align: center;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 2rem;
    border-radius: 0;
    backdrop-filter: none;
    overflow: visible;
}

.page-header::before {
    display: none;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.page-icon {
    font-size: 1.5rem;
    color: var(--color-accent);
    opacity: 1;
}

.page-description {
    font-size: 0.95rem;
    color: var(--color-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.5;
    font-weight: 400;
}

/* ===== 서비스 카드 ===== */
.service-content {
    background: var(--color-bg-card);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 1rem;
    backdrop-filter: none;
}

/* ===== 검색 섹션 ===== */
.search-section {
    padding: 0;
}

.search-section h2 {
    text-align: left;
    margin-bottom: 1.25rem;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.search-section h2 i {
    font-size: 1rem;
    color: var(--color-accent);
}

/* ===== 입력 그룹 ===== */
.input-group-custom {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.input-group-custom label {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.input-group-custom label i {
    font-size: 0.8rem;
    color: var(--color-secondary);
}

/* ===== 폼 컨트롤 (고대비) ===== */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: 'Pretendard', sans-serif;
    color: var(--color-primary);
    background-color: var(--color-input-bg);
    border: 1.5px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    background-color: #FFFFFF;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-control::placeholder {
    color: var(--color-placeholder);
    opacity: 1;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* ===== 버튼 ===== */
.btn {
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Pretendard', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-accent);
}

.btn-ai {
    background-color: var(--color-accent);
    color: white;
}

.btn-ai:hover {
    background-color: var(--color-accent-hover);
}

.btn-secondary {
    background: var(--color-secondary);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--color-border-strong);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-bg-page);
    border-color: var(--color-primary);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-secondary);
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* ===== 결과 스타일 ===== */
.result-item {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-accent);
}

.result-item h3 {
    color: var(--color-primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.result-item h3 i {
    color: var(--color-accent);
}

.result-item p {
    margin: 0.35rem 0;
    color: var(--color-primary);
    line-height: 1.5;
    font-size: 0.9rem;
}

.result-item strong {
    color: var(--color-primary);
    min-width: 85px;
    display: inline-block;
    font-weight: 600;
}

.assignments-list,
.judges-list {
    margin-top: 0.75rem;
    list-style-type: none;
    padding-left: 0;
}

.assignments-list li,
.judges-list li {
    background: var(--color-bg-page);
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    font-size: 0.9rem;
    transition: var(--transition);
}

.assignments-list li:hover,
.judges-list li:hover {
    border-color: var(--color-accent);
}

/* ===== 정보/에러 메시지 ===== */
.info-message {
    color: var(--color-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem;
    background-color: var(--color-bg-page);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.error-message {
    color: var(--color-danger) !important;
    font-weight: 600;
    background-color: #FEF2F2 !important;
    border-color: #FECACA !important;
}

/* ===== AI 응답 ===== */
.ai-response {
    background: #F8FAFF;
    border-left-color: var(--color-accent);
}

.ai-response h3 {
    color: var(--color-primary);
}

/* ===== 액션 버튼 ===== */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ===== 로딩 ===== */
.loading {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.data-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    flex-direction: column;
    gap: 0.75rem;
}

.data-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===== AI 로딩 ===== */
.ai-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    gap: 1.25rem;
}

.ai-loading-animation {
    position: relative;
    width: 56px;
    height: 56px;
}

.ai-loading-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ai-loading-circle:nth-child(1) {
    border-top-color: var(--color-primary);
    animation: spin 1.2s linear infinite;
}

.ai-loading-circle:nth-child(2) {
    width: 40px;
    height: 40px;
    top: 8px;
    left: 8px;
    border-right-color: var(--color-accent);
    animation: spin-reverse 1s linear infinite;
}

.ai-loading-circle:nth-child(3) {
    width: 24px;
    height: 24px;
    top: 16px;
    left: 16px;
    border-bottom-color: var(--color-secondary);
    animation: spin 0.8s linear infinite;
}

.ai-loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
}

@keyframes spin-reverse {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

.ai-loading-text {
    text-align: center;
}

.ai-loading-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

.ai-loading-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 4px;
}

.ai-loading-dots span {
    width: 4px;
    height: 4px;
    background-color: var(--color-accent);
    border-radius: 50%;
    animation: dots 1.4s ease-in-out infinite both;
}

.ai-loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.ai-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dots {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.ai-loading-subtitle {
    font-size: 0.8rem;
    color: var(--color-secondary);
    margin-top: 0.25rem;
}

.ai-loading-progress {
    width: 160px;
    height: 3px;
    background-color: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.ai-loading-progress-bar {
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* ===== 푸터 (다크 네이비) ===== */
.footer {
    background: var(--color-primary);
    border-top: none;
    padding: 1.25rem 0;
    margin-top: auto;
}

.footer::before {
    display: none;
}

.footer-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.25rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #CBD5E1;
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
}

.footer-links a i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.footer-links a:hover {
    color: #93C5FD;
}

.footer-links a:hover i {
    color: #93C5FD;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.6;
}

/* ===== 모달 ===== */
.home-guide-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.home-guide-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.home-guide-content {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    padding-top: 56px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    position: relative;
}

.service-link-copy {
    position: absolute;
    top: 14px;
    left: 16px;
    right: 46px;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 11px;
    color: white;
    font-weight: 600;
}

.service-link-copy i {
    color: white;
}

.service-link-copy:hover {
    background: var(--color-accent);
}

.service-link-copy.copied {
    background: var(--color-success);
}

.guide-header {
    text-align: center;
    margin-bottom: 16px;
}

.guide-header h3 {
    font-size: 17px;
    color: var(--color-primary);
    margin-bottom: 4px;
    font-weight: 700;
    padding: 0 20px;
    line-height: 1.4;
}

.guide-header p {
    color: var(--color-secondary);
    font-size: 12px;
}

.guide-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--color-secondary);
    transition: var(--transition);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.guide-close:hover {
    background: var(--color-bg-page);
    color: var(--color-primary);
}

.browser-section {
    margin-bottom: 10px;
    padding: 10px;
    background: var(--color-bg-page);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.browser-section h4 {
    font-size: 13px;
    color: var(--color-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.browser-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.samsung-icon {
    background: #1428A0;
    color: white;
    border-radius: 50%;
    font-size: 9px;
    font-weight: bold;
}

.guide-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.guide-steps li {
    font-size: 11px;
    color: var(--color-secondary);
    padding: 2px 0 2px 14px;
    position: relative;
}

.guide-steps li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 3px;
    height: 3px;
    background: var(--color-accent);
    border-radius: 50%;
}

.guide-footer {
    text-align: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.guide-benefit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--color-success);
    font-size: 12px;
    font-weight: 600;
}

.guide-benefit i {
    color: var(--color-success);
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 1.25rem 1rem 2.5rem;
    }

    .page-title {
        font-size: 1.4rem;
        gap: 0.5rem;
    }

    .page-icon {
        font-size: 1.25rem;
    }

    .page-description {
        font-size: 0.85rem;
    }

    .service-content {
        padding: 1.25rem;
    }

    .search-section h2 {
        font-size: 1rem;
    }

    .footer-links {
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }

    .page-icon {
        font-size: 1.15rem;
    }

    .search-section h2 {
        font-size: 0.95rem;
    }
}

@media print {
    body {
        background: white !important;
    }

    .no-print {
        display: none !important;
    }

    .service-content {
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .result-item {
        page-break-inside: avoid;
    }
}

/* ===== 변호사 배너 (다크 네이비) ===== */
.lawyer-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1E293B;
    padding: 8px 14px 8px 10px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #FFFFFF;
    transition: var(--transition);
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lawyer-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.lawyer-icon-box {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.lawyer-icon-box i {
    color: #FFFFFF;
}

.lawyer-text-box {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.lawyer-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.01em;
    font-family: 'Pretendard', sans-serif;
}

.lawyer-subtitle {
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
}

.lawyer-subtitle::after {
    content: '→';
    font-size: 0.8em;
    transition: transform 0.15s;
}

.lawyer-banner:hover .lawyer-subtitle::after {
    transform: translateX(2px);
}

@media (max-width: 768px) {
    .lawyer-banner {
        bottom: 14px;
        right: 14px;
        padding: 7px 12px 7px 9px;
    }

    .lawyer-icon-box {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }

    .lawyer-title {
        font-size: 0.68rem;
    }
}