/* quote.css — 견적 요청 폼 스타일 (CR v3.0) */

:root {
    --q-primary: #046bd2;
    --q-primary-dark: #0d5aa7;
    --q-primary-light: #4A90E2;
    --q-text-dark: #2C3E50;
    --q-text-light: #7F8C8D;
    --q-bg: #F5F7FA;
    --q-white: #FFFFFF;
    --q-success: #27AE60;
    --q-danger: #E74C3C;
    --q-shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --q-shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --q-radius: 16px;
    --q-transition: all 0.3s ease;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: var(--q-text-dark);
    background: var(--q-bg);
    min-height: 100vh;
}

/* ── Nav ─────────────────────────────────────────────── */
.quote-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--q-shadow-sm);
    padding: 0.75rem 0;
}
.quote-nav .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.quote-nav .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--q-text-dark);
    font-weight: 700;
    font-size: 1.1rem;
}
.quote-nav .logo img {
    height: 32px;
    width: auto;
}
.quote-nav .nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--q-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--q-transition);
}
.quote-nav .nav-back:hover { opacity: 0.7; }

/* ── Container ───────────────────────────────────────── */
.quote-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 6rem 1.5rem 3rem;
}

/* ── Header ──────────────────────────────────────────── */
.quote-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.quote-header .service-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--q-primary), var(--q-primary-dark));
    color: var(--q-white);
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
.quote-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--q-text-dark);
    margin-bottom: 0.5rem;
}
.quote-header p {
    color: var(--q-text-light);
    font-size: 1rem;
}

/* ── Form Card ───────────────────────────────────────── */
.quote-form-card {
    background: var(--q-white);
    border-radius: var(--q-radius);
    box-shadow: var(--q-shadow-md);
    padding: 2.5rem;
}
@media (max-width: 600px) {
    .quote-form-card { padding: 1.5rem; }
}

/* ── Form Group ──────────────────────────────────────── */
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--q-text-dark);
    margin-bottom: 0.4rem;
}
.form-group label .required {
    color: var(--q-danger);
    margin-left: 2px;
}
.form-group label .optional {
    color: var(--q-text-light);
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: 4px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--q-text-dark);
    background: var(--q-white);
    transition: var(--q-transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--q-primary);
    box-shadow: 0 0 0 3px rgba(4,107,210,0.1);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #B0B0B0;
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
}
.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237F8C8D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}
.form-group .field-hint {
    font-size: 0.8rem;
    color: var(--q-text-light);
    margin-top: 0.3rem;
}

/* ── Two-col row ─────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
@media (max-width: 500px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ── Turnstile ───────────────────────────────────────── */
.turnstile-wrapper {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

/* ── Submit ───────────────────────────────────────────── */
.btn-submit {
    display: block;
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--q-primary), var(--q-primary-dark));
    color: var(--q-white);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--q-transition);
    box-shadow: 0 4px 15px rgba(4,107,210,0.3);
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(4,107,210,0.4);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-submit .spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result / Status ─────────────────────────────────── */
.form-status {
    text-align: center;
    padding: 1rem;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 1rem;
    display: none;
}
.form-status.success {
    display: block;
    background: #E8F5E9;
    color: var(--q-success);
}
.form-status.error {
    display: block;
    background: #FFEBEE;
    color: var(--q-danger);
}
.form-status.info {
    display: block;
    background: #E3F2FD;
    color: #1565C0;
}

/* ── Footer ──────────────────────────────────────────── */
.quote-footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--q-text-light);
    font-size: 0.85rem;
}
.quote-footer a {
    color: var(--q-primary);
    text-decoration: none;
}
.quote-footer a:hover { text-decoration: underline; }

/* ── Tab Switcher ────────────────────────────────────── */
.quote-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: 2px solid #E0E0E0;
    border-radius: 50px;
    background: var(--q-white);
    color: var(--q-text-light);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--q-transition);
}
.tab-btn:hover {
    border-color: var(--q-primary-light);
    color: var(--q-primary);
}
.tab-btn.active {
    background: linear-gradient(135deg, var(--q-primary), var(--q-primary-dark));
    color: var(--q-white);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(4,107,210,0.25);
}

/* ── Tab Panels ─────────────────────────────────────── */
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Chat UI ────────────────────────────────────────── */
.chat-card {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    min-height: 380px;
    max-height: 480px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}

.chat-bubble {
    display: flex;
    max-width: 85%;
}
.chat-bubble.user {
    align-self: flex-end;
}
.chat-bubble.assistant {
    align-self: flex-start;
}

.bubble-content {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
}
.chat-bubble.user .bubble-content {
    background: linear-gradient(135deg, var(--q-primary), var(--q-primary-dark));
    color: var(--q-white);
    border-bottom-right-radius: 4px;
}
.chat-bubble.assistant .bubble-content {
    background: #F0F2F5;
    color: var(--q-text-dark);
    border-bottom-left-radius: 4px;
}

/* 타이핑 인디케이터 */
.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    height: 20px;
}
.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--q-text-light);
    animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* 입력 영역 */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #E8E8E8;
    background: var(--q-white);
}
.chat-input-area textarea {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 2px solid #E0E0E0;
    border-radius: 20px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--q-text-dark);
    background: var(--q-bg);
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.2s;
}
.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--q-primary);
}
.chat-input-area textarea::placeholder {
    color: #B0B0B0;
}
.chat-input-area button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--q-primary), var(--q-primary-dark));
    color: var(--q-white);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--q-transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(4,107,210,0.3);
}
.chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 채팅 제출 영역 */
.chat-submit-area {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #E8E8E8;
    text-align: center;
}
.chat-ready-msg {
    color: var(--q-success);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
}
.chat-ready-msg i {
    margin-right: 0.3rem;
}

/* ── Loading skeleton ────────────────────────────────── */
.quote-header.loading .service-badge,
.quote-header.loading h1 {
    background: #E0E0E0;
    color: transparent;
    border-radius: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.5; }
}
