/* ============================================================
   H2GO Design Refinement — v2 polish on v1 foundation
   세련되게 · 모던하게 · 간결하게

   이 파일은 기존 스타일 위에 레이어로 로드됩니다.
   (colors_and_type.css → styles.css → dashboard.css → h2go-refine.css)
   ============================================================ */

/* ── 0. 타이포 기반 개선 ──────────────────────────────────── */
html,
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ── 1. 배경: 앰비언트 블롭 심화 ─────────────────────────── */
body::before {
    background:
        radial-gradient(circle at 35% 35%, rgba(59, 130, 246, 0.16) 0%, transparent 58%),
        radial-gradient(circle at 75% 65%, rgba(96, 165, 250, 0.07) 0%, transparent 48%);
    filter: blur(56px);
    opacity: 1;
}

body::after {
    background:
        radial-gradient(circle at 45% 45%, rgba(96, 165, 250, 0.08) 0%, transparent 52%),
        radial-gradient(circle at 58% 55%, rgba(59, 130, 246, 0.11) 0%, transparent 42%),
        radial-gradient(circle at 18% 78%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
    filter: blur(58px);
    opacity: 0.7;
}

/* ── 2. 브랜드 마크 ──────────────────────────────────────── */
.brand-h2 {
    text-shadow: 0 0 22px rgba(59, 130, 246, 0.40);
}

.brand-mark--xl .brand-h2 {
    text-shadow: 0 0 32px rgba(59, 130, 246, 0.45);
}

/* ── 3. 로그인 카드: 글라스 강화 ─────────────────────────── */
.auth-only-card {
    background: color-mix(in srgb, var(--bg-card) 86%, transparent);
    border: 1px solid color-mix(in srgb, var(--h2-blue) 22%, var(--border-color));
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.055) inset,
        0 28px 72px rgba(0, 0, 0, 0.34),
        0 0 0 1px rgba(59, 130, 246, 0.06);
    position: relative;
    overflow: hidden;
}

/* 상단 그라디언트 라인 — v2 글라스 카드 시그니처 */
.auth-only-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.55) 35%,
        rgba(96, 165, 250, 0.60) 55%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ── 4. Auth 칩: 블루 틴트 ───────────────────────────────── */
.auth-feature-chips [role="listitem"] {
    border: 1px solid rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.09);
    color: var(--h2-blue-light);
    letter-spacing: 0.04em;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-feature-chips [role="listitem"]:hover {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.15);
}

/* ── 5. 버튼: 그라디언트 primary + 글로우 ────────────────── */
.btn {
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(145deg, var(--h2-blue) 0%, var(--h2-blue-dark) 100%);
    box-shadow: 0 2px 14px rgba(59, 130, 246, 0.22);
    transition: background 0.2s ease, box-shadow 0.25s ease, transform 0.15s ease, border-color 0.2s ease;
}

.btn-primary:hover {
    background: linear-gradient(145deg, var(--h2-blue-light) 0%, var(--h2-blue) 100%);
    box-shadow: 0 6px 24px rgba(59, 130, 246, 0.40), 0 0 0 1px rgba(96, 165, 250, 0.30);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97) translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.18);
}

/* Secondary: 서브틀 글라스 아웃라인 */
.btn-secondary {
    background: rgba(107, 114, 128, 0.12);
    border: 1px solid rgba(107, 114, 128, 0.30);
    color: var(--text-white);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-secondary:hover {
    background: rgba(107, 114, 128, 0.22);
    border-color: rgba(107, 114, 128, 0.50);
    box-shadow: none;
    color: var(--text-white);
}

/* btn-tiny: 대시보드 인라인 버튼 일관성 */
.btn-tiny {
    font-size: 0.775rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    min-height: 1.875rem;
    padding: 0 0.65rem;
}

/* ── 6. 폼 입력: 포커스 링 개선 ──────────────────────────── */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
input[type="email"],
textarea,
select,
.orders-search-input,
.orders-date-input {
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-form input:focus,
.auth-form select:focus,
.form-group input:focus,
.form-group select:focus,
.orders-search-input:focus,
.orders-date-input:focus {
    border-color: var(--h2-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.13);
    outline: none;
}

/* ── 7. 내비게이션바: 강화된 글라스 ──────────────────────── */
.navbar {
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid color-mix(in srgb, var(--h2-blue) 16%, var(--border-color));
}

/* ── 8. 대시보드 뷰 헤더 히어로 ─────────────────────────── */
.view-header--hero {
    position: relative;
}

.view-header--dashboard-top {
    padding-bottom: 1.25rem;
    margin-bottom: 0.5rem;
}

.view-header--dashboard-top::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -1.5rem;
    right: -1.5rem;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in srgb, var(--h2-blue) 30%, var(--border-color)) 20%,
        color-mix(in srgb, var(--h2-blue) 30%, var(--border-color)) 80%,
        transparent 100%);
    pointer-events: none;
}

/* ── 9. 주문 현황 카드: 세련된 그림자 ─────────────────────── */
.my-orders-card,
.supplier-orders-card {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 12px 40px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(59, 130, 246, 0.045);
}

/* ── 10. 주문 카드: 호버 트랜지션 ───────────────────────────── */
.order-item {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.order-item-clickable:hover:not(.is-selected) {
    border-color: color-mix(in srgb, var(--h2-blue) 28%, var(--border-color));
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.08);
}

.order-item.is-selected {
    border-color: color-mix(in srgb, var(--h2-blue) 58%, var(--border-color));
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.14);
}

/* ── 11. 모달: 글라스 + 상단 라인 ───────────────────────────── */
.modal {
    backdrop-filter: blur(6px) brightness(0.74);
    -webkit-backdrop-filter: blur(6px) brightness(0.74);
}

.modal-content {
    border-color: color-mix(in srgb, var(--h2-blue) 20%, var(--border-color));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.045) inset,
        0 28px 72px rgba(0, 0, 0, 0.42);
    position: relative;
    overflow: hidden;
}

/* 모달 상단 그라디언트 라인 */
.modal-content::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.45) 40%,
        rgba(96, 165, 250, 0.45) 60%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ── 12. 주문 알림 카드: 글라스 강화 ────────────────────────── */
.dashboard-order-notifications-card.dashboard-order-notifications--beside-title {
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-color: color-mix(in srgb, var(--h2-blue) 22%, var(--border-color));
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.045) inset,
        0 10px 36px rgba(0, 0, 0, 0.24);
}

/* ── 13. 인사이트 타일: 블루 틴트 ───────────────────────────── */
.order-card-insight-tile,
.insight-clock-block.order-card-insight-tile {
    background: color-mix(in srgb, var(--h2-blue) 7%, var(--bg-card));
    border-color: color-mix(in srgb, var(--h2-blue) 16%, var(--border-color));
    transition: border-color 0.18s ease;
}

/* ── 14. 사이드바 내비 버튼 ──────────────────────────────── */
.sidebar-nav-btn {
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: background 0.15s ease, border-color 0.15s ease;
}

/* ── 15. 운송 기사 헤더: 글라스 ──────────────────────────── */
.driver-header {
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
}

/* ── 16. 헤더 타이포그래피 개선 ──────────────────────────── */
.view-header--hero h1 {
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.my-orders-header-title h3,
.my-orders-card h3 {
    font-weight: 700;
    letter-spacing: -0.015em;
}

.new-order-modal-title,
.modal-header h2,
.modal-header h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ── 17. 라이트 테마 미세 조정 ───────────────────────────── */
body.theme-light .auth-only-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(59, 130, 246, 0.20);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 20px 56px rgba(15, 23, 42, 0.09),
        0 0 0 1px rgba(59, 130, 246, 0.06);
}

body.theme-light .auth-only-card::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.30) 35%,
        rgba(96, 165, 250, 0.30) 55%,
        transparent 100%);
}

body.theme-light .auth-feature-chips [role="listitem"] {
    border-color: rgba(59, 130, 246, 0.22);
    background: rgba(59, 130, 246, 0.06);
    color: var(--h2-blue-dark);
}

body.theme-light .modal-content {
    border-color: rgba(59, 130, 246, 0.16);
}

body.theme-light .modal-content::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.22) 40%,
        rgba(96, 165, 250, 0.22) 60%,
        transparent 100%);
}

body.theme-light .my-orders-card,
body.theme-light .supplier-orders-card {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 8px 30px rgba(15, 23, 42, 0.07),
        0 0 0 1px rgba(59, 130, 246, 0.06);
}

body.theme-light .order-item-clickable:hover:not(.is-selected) {
    border-color: rgba(59, 130, 246, 0.28);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.06);
}

body.theme-light .btn-secondary {
    background: rgba(107, 114, 128, 0.08);
    border-color: rgba(107, 114, 128, 0.25);
    color: var(--text-primary);
}

body.theme-light .btn-secondary:hover {
    background: rgba(107, 114, 128, 0.15);
    border-color: rgba(107, 114, 128, 0.40);
}

body.theme-light .view-header--dashboard-top::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(59, 130, 246, 0.20) 20%,
        rgba(59, 130, 246, 0.20) 80%,
        transparent 100%);
}

body.theme-light .order-card-insight-tile,
body.theme-light .insight-clock-block.order-card-insight-tile {
    background: color-mix(in srgb, var(--h2-blue) 5%, var(--bg-card));
    border-color: color-mix(in srgb, var(--h2-blue) 12%, var(--border-color));
}
