/* 다크 테마 색상 변수 */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #4a9eff;
    --accent-hover: #357abd;
    --border: #333333;
    --overlay: rgba(0, 0, 0, 0.8);
    --error: #ff4444;
    --success: #44ff44;
}

/* 기본 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', 'Pretendard', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 모달 오버레이 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay);
    backdrop-filter: blur(10px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* 모달 컨테이너 */
.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
    transform: translateY(0);
}

/* 모달 헤더 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 모달 바디 */
.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* 폼 섹션 */
.form-section {
    margin-bottom: 32px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* 폼 그룹 */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 폼 라벨 */
.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.required {
    color: var(--error);
}

/* 폼 입력 필드 */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-secondary);
}

/* 셀렉트 박스 */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* 텍스트 영역 */
.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* 날짜/시간 입력 */
.datetime-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.datetime-input {
    flex: 1;
}

.btn-icon {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-primary);
}

.btn-remove {
    color: var(--error);
}

/* 버튼 */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* 폼 액션 */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* 로딩 상태 */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 에러 메시지 */
.error-message {
    color: var(--error);
    font-size: 14px;
    margin-top: 4px;
}

/* 성공 메시지 */
.success-message {
    background: rgba(68, 255, 68, 0.1);
    border: 1px solid var(--success);
    border-radius: 8px;
    padding: 16px;
    color: var(--success);
    text-align: center;
    margin-top: 16px;
}

/* 전체 화면 성공 메시지 */
.success-message-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #00c851 0%, #00a049 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: successFadeIn 0.4s ease-out;
    z-index: 999999;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 체크마크 애니메이션 */
.success-animation {
    width: 100px;
    height: 100px;
    margin-bottom: 2rem;
}

.checkmark {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #4ade80;
    stroke-miterlimit: 10;
    animation: scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4ade80;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

/* 성공 메시지 텍스트 */
.success-title {
    font-size: 2rem;
    color: #4ade80;
    margin-bottom: 1rem;
    font-weight: 600;
}

.success-text {
    font-size: 1.1rem;
    color: #86efac;
    margin-bottom: 0.5rem;
}

.success-subtext {
    font-size: 0.95rem;
    color: #6ee7b7;
    opacity: 0.8;
}

/* 모달 (데모/견적 폼용) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* 모달 콘텐츠 (데모/견적 폼용) */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    position: relative;
    overflow: hidden;
}

/* 폼 힌트 */
.form-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 스피너 */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

/* 버튼 로딩 상태 */
.btn-loading {
    display: inline-flex;
    align-items: center;
}

.btn-text {
    display: inline;
}

/* 성공 아이콘 */
.success-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: successIconScale 0.5s ease-out 0.2s both;
}

@keyframes successIconScale {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.success-icon svg {
    width: 80px;
    height: 80px;
}

/* 체크마크 SVG */
.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #ffffff;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    stroke: #ffffff;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.9s forwards;
}

/* 성공 메시지 전체 컨테이너 */
.success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    min-height: 400px;
    text-align: center;
}

.success-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 3rem 4rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: contentSlideUp 0.6s ease-out 0.3s both;
}

@keyframes contentSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message h2 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.success-message p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* label 태그 스타일 (데모/견적 폼용) */
label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* input, select, textarea 태그 스타일 (데모/견적 폼용) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

/* select 태그 화살표 스타일 */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* textarea 리사이즈 */
textarea {
    resize: vertical;
    min-height: 100px;
}

/* 개인정보 동의 섹션 */
.privacy-consent-section {
    background: rgba(74, 158, 255, 0.05);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.privacy-consent-section .section-title {
    font-size: 16px;
    margin-bottom: 12px;
}

/* details/summary 태그 스타일 */
.privacy-details {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.privacy-summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 500;
    color: var(--accent);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s ease;
    user-select: none;
}

.privacy-summary:hover {
    background: rgba(74, 158, 255, 0.1);
}

/* 화살표 아이콘 추가 */
.privacy-summary::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.privacy-details[open] .privacy-summary::after {
    transform: rotate(180deg);
}

/* WebKit 브라우저용 marker 숨김 */
.privacy-summary::-webkit-details-marker {
    display: none;
}

.privacy-content {
    padding: 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    max-height: 300px;
    overflow-y: auto;
}

.privacy-content h4 {
    color: var(--text-primary);
    font-size: 15px;
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.privacy-content h4:first-child {
    margin-top: 0;
}

.privacy-content p {
    margin: 8px 0;
}

.privacy-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.privacy-content li {
    margin: 4px 0;
}

.privacy-content strong {
    color: var(--text-primary);
}

/* 체크박스 컨테이너 */
.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.privacy-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.privacy-checkbox label {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.privacy-checkbox label:hover {
    color: var(--accent);
}

/* 스크롤바 스타일 */
.privacy-content::-webkit-scrollbar {
    width: 8px;
}

.privacy-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.privacy-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.privacy-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}