:root {
    --primary: #3498db;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    /* 카메라 가로세로 비율: 16/9 또는 4/3 */
    --cam-ratio: 16/9;

    /* ── 다크모드 색상 팔레트 ── */
    --bg-base: #0f1117;
    /* 최하단 배경 */
    --bg-layer1: #161b22;
    /* 카드·패널 1단계 */
    --bg-layer2: #1c2333;
    /* 입력폼·사이드바 2단계 */
    --bg-layer3: #21262d;
    /* 호버·구분선 3단계 */
    --border: #30363d;
    /* 구분선 */
    --text-main: #c9d1d9;
    /* 기본 텍스트 */
    --text-muted: #8b949e;
    /* 보조 텍스트 */
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.top-bar {
    background-color: #0d1117;
    color: var(--white);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Layout */
.main-layout {
    display: flex;
    flex: 1;
}

.side-nav {
    width: 200px;
    background-color: var(--bg-layer1);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
}

.side-nav ul {
    list-style: none;
}

.side-nav li {
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}

.side-nav li:hover {
    background-color: var(--bg-layer3);
    color: var(--text-main);
}

.side-nav li.active {
    background-color: rgba(52, 152, 219, 0.12);
    border-left: 4px solid var(--primary);
    color: var(--primary);
}

.side-nav a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
}

/* Card 공통 스타일 (다크) - padding 제거: 개별 요소에서 관리 */
.card {
    background-color: var(--bg-layer1);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-main);
}

/* Main Content Area */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    height: 100%;
    overflow: hidden;
}

#dashboard-view {
    flex: 1;
    display: flex;
    gap: 10px;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Multi-Camera Grid */
.camera-grid {
    flex: 1;
    display: grid;
    gap: 8px;
    width: 100%;
    /* 높이는 셀의 aspect-ratio가 자동 결정 */
    align-content: start;
    background: #121212;
    padding: 8px;
    border-radius: 8px;
    overflow-y: auto;
}

/* 그리드 열 분할 (행은 auto로 aspect-ratio에 맡김) */
.grid-1 {
    grid-template-columns: 1fr;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-8 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-16 {
    grid-template-columns: repeat(4, 1fr);
}

.camera-item {
    background: #000;
    position: relative;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid #333;
    width: 100%;
    /* 비율 고정: 16:9 또는 4:3 (--cam-ratio 변수로 제어) */
    aspect-ratio: var(--cam-ratio);
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.camera-item:hover {
    border-color: var(--primary);
}

.camera-item.active {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5);
}

/* 열선 가동 중인 카메라 강조 (붉은 테두리) */
.camera-item.heater-active {
    border-color: var(--danger) !important;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.7);
    animation: pulse-red 2s infinite;
}

/* ── 제상 상태 표시 ──
   열선만 붉게 하면 어느 단계인지 알 수 없어, 단계별 배지와 화면 색을 함께 준다 */
.camera-item.state-defrost {
    border-color: rgb(231, 76, 60) !important;
    box-shadow: 0 0 22px rgba(231, 76, 60, 0.85);
    animation: pulse-red 1.2s infinite;
}

.camera-item.state-defrost img {
    filter: saturate(1.3) brightness(1.05);
}

/* 제상 중인 화면은 붉은 기가 돌게 덮어 한눈에 구분되게 한다 */
.camera-item.state-defrost::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(231, 76, 60, 0.16);
    pointer-events: none;
}

.camera-item.state-pre_stop {
    border-color: rgb(243, 156, 18) !important;
    box-shadow: 0 0 14px rgba(243, 156, 18, 0.6);
}

.camera-item.state-drip,
.camera-item.state-recover {
    border-color: rgb(52, 152, 219) !important;
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.5);
}

.camera-item.state-fault {
    border-color: rgb(155, 89, 182) !important;
    box-shadow: 0 0 16px rgba(155, 89, 182, 0.7);
}

/* 단계 배지 — 좌상단 고정 */
.camera-item .state-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 0.02em;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

/* 감시 중에는 배지를 숨겨 화면이 번잡해지지 않게 한다 */
.camera-item .state-badge.state-monitor,
.camera-item .state-badge.state-idle {
    display: none;
}

.camera-item .state-badge.state-defrost {
    background: rgb(231, 76, 60);
    border-color: rgb(231, 76, 60);
    animation: badge-blink 1s steps(1) infinite;
}

.camera-item .state-badge.state-pre_stop {
    background: rgb(243, 156, 18);
    border-color: rgb(243, 156, 18);
}

.camera-item .state-badge.state-drip,
.camera-item .state-badge.state-recover {
    background: rgb(52, 152, 219);
    border-color: rgb(52, 152, 219);
}

.camera-item .state-badge.state-fault {
    background: rgb(155, 89, 182);
    border-color: rgb(155, 89, 182);
}

@keyframes badge-blink {
    0%, 60% { opacity: 1; }
    61%, 100% { opacity: 0.35; }
}

/* ── 시뮬레이션 설정 입력 ── */
.setting-item .sim-value {
    margin-left: 0.5rem;
    font-weight: bold;
    color: var(--primary);
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.camera-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.camera-item .info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.camera-item .ch-label {
    font-weight: bold;
}

.camera-item .frost-label {
    color: var(--primary);
}

/* Thumbnail Mini Progress Bar */
.item-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 5;
}

.item-progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--primary);
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Detail Panel */
.detail-panel {
    width: 350px;
    position: sticky;
    top: 2rem;
    transition: transform 0.3s ease, opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-panel.hidden {
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.detail-video {
    background: #000;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.detail-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-video .overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.detail-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat-item label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: bold;
}

.stat-item h3 {
    font-size: 1.5rem;
    margin: 5px 0;
}

.w-100 {
    width: 100%;
}

/* Log Ticker */
.log-ticker {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    overflow-y: auto;
    max-height: 140px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.log-ticker.mini {
    max-height: 100px;
    font-size: 0.8rem;
}

/* 하단 미니 로그 섹션 - 높이 고정하여 camera-grid 공간 확보 */
.mini-logs {
    flex-shrink: 0;
    padding: 0.7rem 1rem;
    max-height: 150px;
}

.mini-logs h2 {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

/* detail-panel 개별 패딩 */
.detail-panel {
    padding: 1rem;
}

/* top-controls 이미 padding 있으므로 .card 패딩 불필요 확인용 주석 */
/* .top-controls 는 자체 padding: 1rem 보유 */

.log-item {
    padding: 2px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.6);
    color: var(--text-main);
}

.log-time {
    color: var(--text-muted);
    margin-right: 4px;
}

/* TOP Controls */
.top-controls {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-layer1);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* 섹션 공통 제목 색상 */
h2,
h3,
h4 {
    color: var(--text-main);
}

.row {
    flex-direction: row !important;
    align-items: center;
}

#select-camera-count {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-layer2);
    color: var(--text-main);
}

#select-aspect-ratio {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-layer2);
    color: var(--text-main);
}

/* Logs Area */
.logs-area {
    margin-top: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.logs-area h2 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.log-controls {
    display: flex;
    justify-content: flex-end;
}

/* Settings Area */
.settings-area {
    margin-top: 1rem;
    max-width: 600px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-weight: bold;
    color: var(--text-main);
}

.setting-item input[type="number"] {
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg-layer2);
    color: var(--text-main);
    width: 100px;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 게이지 컨테이너 */
.gauge-container {
    background: var(--bg-layer2);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-top: 4px;
}

.gauge-fill {
    height: 100%;
    border-radius: 4px;
    background-color: var(--primary);
    transition: width 0.5s ease, background-color 0.3s;
}

/* 상태 배지 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
}

.status-badge.normal {
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
    border: 1px solid rgba(46, 204, 113, 0.35);
}

/* 제상 준비·물빠짐·복귀 단계용. 위험은 아니지만 평상시도 아니다 */
.status-badge.warning {
    background: rgba(243, 156, 18, 0.2);
    color: rgb(243, 156, 18);
    border: 1px solid rgba(243, 156, 18, 0.5);
}

.status-badge.danger {
    background: rgba(231, 76, 60, 0.15);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.35);
}

/* 공통 버튼 */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.15s, transform 0.1s;
}

.btn:hover {
    opacity: 0.85;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.hidden {
    display: none !important;
}

/* ===================================================
   반응형 미디어 쿼리 (Responsive Media Queries)
   =================================================== */

/* 태블릿 (1200px 이하) */
@media (max-width: 1200px) {
    .dashboard-main-area {
        flex-direction: column;
        overflow-y: auto;
    }

    .detail-panel {
        width: 100%;
        position: static;
        max-height: 60vh;
        overflow-y: auto;
    }

    .grid-8 {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: 1fr 1fr;
    }

    .grid-16 {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }

    .settings-area {
        max-width: 100%;
    }
}

/* 태블릿 세로 / 중간 모바일 (768px 이하) */
@media (max-width: 768px) {

    /* 앱 컨테이너: 하단 탭바 공간 확보 */
    .app-container {
        height: 100dvh;
        /* 동적 뷰포트 높이 (모바일 주소창 대응) */
    }

    /* 헤더 */
    .top-bar {
        padding: 0.6rem 1rem;
    }

    .top-bar h1 {
        font-size: 1rem;
    }

    .user-info {
        font-size: 0.75rem;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
    }

    /* 메인 레이아웃: 사이드 네비게이션 숨기고 하단 탭바로 전환 */
    .main-layout {
        flex-direction: column;
        flex: 1;
        overflow: hidden;
    }

    .side-nav {
        display: none;
        /* 모바일에서 좌측 사이드바 숨김 */
    }

    /* 컨텐츠 영역 */
    .content {
        padding: 8px 8px 70px 8px;
        /* 하단 탭바 높이만큼 패딩 */
        overflow-y: auto;
        flex: 1;
    }

    /* 카메라 그리드 영역 */
    #dashboard-view {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
        min-height: 0;
    }

    .camera-grid {
        height: auto;
        overflow-y: visible;
    }

    /* 그리드 모바일 열 최적화 (aspect-ratio가 높이를 자동 결정) */
    .grid-1 {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .grid-8 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .grid-16 {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }

    .camera-item {
        height: auto;
        aspect-ratio: var(--cam-ratio);
    }

    /* 상세 패널: 모바일에서 bottom-sheet 모달 방식 */
    .detail-panel {
        width: 100%;
        position: fixed;
        bottom: 60px;
        /* 하단 탭바 위 */
        left: 0;
        right: 0;
        z-index: 300;
        max-height: 75vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.7);
        background: var(--bg-layer1);
        padding: 0 !important;
    }

    /* 패널 상단 핸들 바 (드래그 힌트) */
    .detail-panel::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border);
        border-radius: 2px;
        margin: 10px auto 0;
    }

    /* 패널 내부 패딩 */
    .detail-content {
        padding: 0 1rem 1rem;
    }

    .panel-header {
        padding: 0.8rem 1rem 0.5rem;
        position: sticky;
        top: 0;
        background: var(--bg-layer1);
        z-index: 1;
    }

    .detail-panel.hidden {
        display: none !important;
    }

    /* 딤 오버레이: 패널 열릴 때 배경 흐리게 */
    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 299;
    }

    .mobile-overlay.active {
        display: block;
    }

    /* 상단 컨트롤 */
    .top-controls {
        margin-bottom: 0.5rem;
        padding: 0.6rem 0.8rem;
    }

    .control-group.row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* 미니 로그 */
    .mini-logs {
        display: none;
        /* 모바일에서 하단 로그 숨김 (공간 절약) */
    }

    /* 활동 로그 뷰 */
    .logs-area {
        margin-top: 0;
    }

    #full-log-list {
        height: calc(100dvh - 200px) !important;
    }

    /* 설정 화면 */
    .settings-area {
        max-width: 100%;
        margin-top: 0;
    }
}

/* 소형 모바일 (480px 이하) */
@media (max-width: 480px) {
    .top-bar h1 {
        font-size: 0.85rem;
    }

    .user-info {
        font-size: 0.7rem;
    }

    /* 소형 모바일: 1대일 때만 1열, 나머지 2열 유지 */
    .grid-1 {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-8 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-16 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================================
   모바일 하단 탭바 (Bottom Navigation Bar)
   모바일에서만 표시, PC에서는 숨김
   =================================================== */
.bottom-nav {
    display: none;
    /* PC에서는 숨김 */
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: var(--dark);
        border-top: 1px solid #444;
        z-index: 200;
        justify-content: space-around;
        align-items: stretch;
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        color: #aaa;
        cursor: pointer;
        gap: 3px;
        font-size: 0.65rem;
        border: none;
        background: none;
        padding: 0;
        transition: color 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-item .nav-icon {
        font-size: 1.3rem;
        line-height: 1;
    }

    .bottom-nav-item.active {
        color: var(--primary);
    }

    .bottom-nav-item:active {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* ===================================================
   로그인 오버레이 (Login Overlay)
   =================================================== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #1a2a3a 0%, #0d1b2a 50%, #1a2a3a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInOverlay 0.4s ease;
}

.login-overlay.hidden {
    display: none !important;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-logo {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 15px rgba(52, 152, 219, 0.6));
}

.login-title {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: 0.02em;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.login-field {
    text-align: left;
    margin-bottom: 1rem;
}

.login-field label {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.login-field input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

.login-field input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-field input:focus {
    border-color: var(--primary);
    background: rgba(52, 152, 219, 0.12);
}

.login-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    color: #e74c3c;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: left;
}

.btn-login {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary), #2980b9);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 0.5rem;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.55);
}

.btn-login:active {
    transform: translateY(0);
}

/* 로그아웃 버튼 */
.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 0.5rem;
}

.btn-logout:hover {
    background: rgba(231, 76, 60, 0.5);
    border-color: var(--danger);
}

/* ── 개발노트 버튼: 로그아웃과 같은 크기·틀, 위험 동작이 아니므로 hover 색만 다르게 ── */
.btn-devnote:hover {
    background: rgba(52, 152, 219, 0.5);
    border-color: rgba(52, 152, 219, 0.9);
}

@media (max-width: 480px) {
    .login-card {
        margin: 1rem;
        padding: 2rem 1.5rem;
    }

    .btn-logout {
        font-size: 0.65rem;
        padding: 2px 7px;
    }
}