/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    --side-bg: #f8fafc; --main-bg: #ffffff; --app-bg: #f1f5f9;
    --primary: #6366f1; --primary-hover: #4f46e5;
    --secondary: #10b981; --secondary-hover: #059669;
    --danger: #ef4444; --danger-hover: #dc2626;
    --text-main: #1e293b; --text-muted: #64748b; --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --font-family: 'Inter', sans-serif; --sidebar-width: 300px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-family); background-color: var(--app-bg); color: var(--text-main); overflow: hidden; }
.hidden { display: none !important; }
#app { display: flex; flex-direction: column; height: 100vh; }

header { height: 60px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; z-index: 10; }
.brand-container { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; transition: opacity 0.2s; }
.brand-container:hover { opacity: 0.8; }
#app-icon { width: 28px; height: 28px; object-fit: contain; }
header h1 { font-size: 1.25rem; color: var(--primary); font-weight: 700; letter-spacing: -0.5px; margin: 0; }
.header-controls { display: flex; align-items: center; gap: 1rem; }
#mobile-menu-btn { display: block; background: transparent; border: none; color: var(--text-main); font-size: 1.4rem; cursor: pointer; padding: 0; transition: color 0.2s; }
#mobile-menu-btn:hover { color: var(--primary); }
.language-selector { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); }
.language-selector i { font-size: 0.9rem; }
#language-switcher { border: none; background: transparent; color: var(--text-main); font-size: 0.9rem; padding: 0.25rem; border-radius: 4px; cursor: pointer; }
#language-switcher:focus { outline: 1px solid var(--primary); }

#main-container { display: flex; flex: 1; overflow: hidden; }
#left-pane { width: var(--sidebar-width); background-color: var(--side-bg); border-right: 1px solid var(--border); transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s; overflow: hidden; flex-shrink: 0; opacity: 1; display: flex; flex-direction: column;}
#left-pane.collapsed { width: 0; opacity: 0; border-right-color: transparent; }
.sidebar-content { padding: 1.5rem; width: var(--sidebar-width); height: 100%; display: flex; flex-direction: column; flex: 1;}
#left-pane h2 { font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 1rem; }
#settlement-list-container { overflow-y: auto; flex: 1; padding-bottom: 0rem; }

/* 초대 코드로 참가 버튼 추가 */
.join-by-code-container { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: white; }
#open-join-modal-btn { width: 100%; background: #eef2ff; color: var(--primary); border: 1px dashed var(--primary); padding: 0.75rem; border-radius: 8px; font-weight: 600; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 0.5rem; transition: background 0.2s; }
#open-join-modal-btn:hover { background: #e0e7ff; }

.settlement-item-wrapper { display: flex; align-items: center; gap: 0.5rem; width: 100%; margin-bottom: 0.6rem; }
.settlement-item { flex-grow: 1; padding: 0.85rem 1rem; border-radius: 8px; background: white; border: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; font-size: 0.9rem; color: var(--text-main); box-shadow: var(--shadow-sm); overflow: hidden; }
.settlement-item .item-content { display: flex; align-items: flex-start; flex: 1; min-width: 0; }
.item-text-group { display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; width: 100%; }

.date-row { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 4px; }
.item-date-badge { font-size: 0.75rem; color: var(--primary); font-weight: 600; background: #eef2ff; padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; }
.settled-icon { color: var(--secondary); flex-shrink: 0; font-size: 1.1rem; }
.settlement-item.active .settled-icon { color: #34d399; } 

.settlement-item .item-title { font-weight: 600; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; text-align: left; width: 100%; }
.settlement-item:hover { background: #f9fafb; border-color: #d1d5db; }
.item-participants { width: 100%; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }

.settlement-item.active { background: var(--primary); color: white; border-color: var(--primary); }
.settlement-item.active .item-date-badge { color: white; background: rgba(255,255,255,0.2); }
.settlement-item.active .item-participants { color: rgba(255, 255, 255, 0.7); background: transparent; }

.settlement-item.is-settled { opacity: 0.9; } 
.settlement-item.active.is-settled { background: #5a67d8; }

.delete-settlement-btn { background: #fee2e2; color: var(--danger); border: 1px solid #fecaca; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.delete-settlement-btn:hover { background: var(--danger); color: white; border-color: var(--danger); }

.leave-settlement-btn { background: #f8fafc; color: var(--text-muted); border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.leave-settlement-btn:hover { background: #e2e8f0; color: var(--text-main); }

#right-pane { flex: 1; background-color: var(--main-bg); overflow-y: auto; padding: 2.5rem; display: flex; flex-direction: column; align-items: center; }
#right-pane > div { width: 100%; max-width: 800px; }
#placeholder-right-pane { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--text-muted); }
#placeholder-right-pane i { font-size: 4rem; margin-bottom: 1.5rem; color: var(--border); }

#calculator { animation: fadeIn 0.5s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.settlement-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid var(--app-bg); flex-wrap: wrap; gap: 1rem;}
.header-title-group { display: flex; align-items: center; gap: 0.8rem; }
.header-action-group { display: flex; gap: 0.5rem; flex-wrap: wrap;}
#settlement-display { font-size: 1.75rem; font-weight: 800; margin-bottom: 0; }

.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border); padding: 0.5rem 0.8rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; }
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn-outline i { color: var(--primary); }

.card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.card h2 { font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0; }

#summary-card { background: linear-gradient(to right, #6366f1, #818cf8); color: white; border: none; display: flex; justify-content: space-between; align-items: center; }
#summary-card h2 { color: white; opacity: 0.9; margin-bottom: 0.5rem;}
.summary-left { flex-grow: 1; min-width: 200px; }
.summary-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
#total-expense { font-size: 1rem; opacity: 0.9; }

#final-settlement-container { margin-bottom: 0rem; text-align: right; }
.transfer-item { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; }

#expense-form-card.is-settled, .is-settled .delete-settlement-btn, .is-settled .leave-settlement-btn { opacity: 0.6; pointer-events: none; user-select: none; }
.form-grid-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
#expense-form { margin-top: 1.25rem; }
#expense-form > button { width: 100%; margin-top: 0.5rem; }

input, select { width: 100%; padding: 0.75rem 1rem; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 0.95rem; font-family: var(--font-family); color: var(--text-main); background-color: #f8fafc; -webkit-appearance: none; appearance: none; text-overflow: ellipsis; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); transition: all 0.2s ease-in-out; }
input:hover, select:hover { background-color: #ffffff; border-color: #cbd5e1; }
input:focus, select:focus { outline: none; background-color: #ffffff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); position: relative; z-index: 1; }
select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 1rem center; background-repeat: no-repeat; background-size: 1.2em 1.2em; padding-right: 2.5rem; cursor: pointer; }

.amount-input-wrapper { display: flex; }
.amount-input-wrapper input { flex-grow: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.amount-input-wrapper select { width: auto; border-top-left-radius: 0; border-bottom-left-radius: 0; }
button { background: var(--primary); color: white; padding: 0.75rem 1.25rem; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; transition: background 0.2s; font-size: 0.95rem; }
button:hover { background: var(--primary-hover); }
button:disabled { background-color: var(--text-muted); cursor: not-allowed; }

#complete-settlement-btn { width: 220px; margin-top: 0.2rem; text-align: center;}
#complete-settlement-btn.edit-mode { background-color: var(--secondary); }
#complete-settlement-btn.edit-mode:hover { background-color: var(--secondary-hover); }

.participant-input-group { display: flex; align-items: center; gap: 0.5rem; width: 100%; }
.remove-participant-btn { background: #fee2e2; color: var(--danger); border: 1px solid #fecaca; width: 44px; height: 44px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; padding: 0;}
.remove-participant-btn:hover { background: var(--danger); color: white; border-color: var(--danger); }
.remove-participant-btn:disabled { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; cursor: not-allowed; }

#add-participant-btn { background-color: transparent; color: var(--primary); border: 1px dashed var(--primary); padding: 0.75rem; border-radius: 8px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; transition: all 0.2s; }
#add-participant-btn:hover { background-color: #eef2ff; }

.dynamic-split-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.dynamic-split-item { display: flex; flex-direction: column; gap: 0.4rem; }
.dynamic-split-item label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 0.2rem; }

.rate-config-wrapper { background-color: #eef2ff; border: 1px solid #c7d2fe; border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.9rem; animation: fadeIn 0.3s ease; }
.rate-config-inner { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.5rem; padding-bottom: 0.75rem; border-bottom: 1px dashed #a5b4fc; }
.rate-input-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.rate-label { color: var(--primary); font-weight: 600; }
.rate-input-box { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--text-main); }
.rate-input-box input { width: 90px; padding: 0.2rem 0.4rem; border-radius: 4px; font-size: 0.95rem; text-align: right; border: 1px solid #c7d2fe; background: white; }
.rate-input-box input:focus { border-color: var(--primary); outline: none; box-shadow: none; }
.rate-action-buttons { display: flex; gap: 0.5rem; width: 100%; }
.rate-btn.btn-outline-small { flex: 1; padding: 0.5rem; font-size: 0.85rem; background: white; color: var(--primary); border: 1px solid #c7d2fe; border-radius: 6px; cursor: pointer; transition: all 0.2s; display: flex; justify-content: center; align-items: center; gap: 0.4rem; font-weight: 600; margin-top: 0; }
.rate-btn.btn-outline-small:hover { background: var(--primary); color: white; border-color: var(--primary); }
.converted-preview { text-align: right; color: var(--text-main); font-weight: 500; font-size: 0.95rem; }
.converted-preview strong { color: var(--primary); font-size: 1.05rem; margin-left: 0.3rem;}

#expense-table-container { overflow-x: auto; width: 100%; }
#expense-table { width: 100%; border-collapse: collapse; min-width: max-content; }
#expense-table th, #expense-table td { padding: 0.75rem 1rem; text-align: center; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; white-space: nowrap; }
#expense-table td:first-child, #expense-table th:first-child { text-align: left; }
#expense-table tbody tr { transition: background-color 0.2s; }
#expense-table tbody tr:not(.is-settled) { cursor: pointer; }
#expense-table tbody tr:not(.is-settled):hover { background-color: #f8fafc; }
#expense-table th { background-color: var(--side-bg); color: var(--text-muted); font-weight: 600; }
#expense-table td:last-child, #expense-table th:last-child { text-align: center; }

.clickable-amount { color: var(--primary); border-bottom: 1px dashed var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding-bottom: 2px; }
.clickable-amount:hover { color: var(--primary-hover); border-bottom-color: var(--primary-hover); }
.delete-expense-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 0.5rem; border-radius: 50%; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.2s, color 0.2s; }
.delete-expense-btn:hover { background: var(--danger); background-color: #fee2e2; }
#expense-table tbody tr.is-settled .delete-expense-btn { opacity: 0.3; pointer-events: none; }
#download-excel-btn { background-color: var(--secondary); font-size: 0.85rem; padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.5rem; }
#download-excel-btn:hover { background-color: var(--secondary-hover); }

#add-settlement-fab { display: flex; justify-content: center; align-items: center; padding: 0; position: fixed; bottom: 2rem; right: 2.5rem; width: 48px; height: 48px; border-radius: 50%; box-shadow: var(--shadow-md); z-index: 5; transition: transform 0.3s; font-size: 1.2rem; }

#add-settlement-modal, #exchange-rate-modal, #expense-rate-modal, #edit-expense-modal, #custom-confirm-modal, #share-modal, #join-modal, #profile-modal, #edit-title-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; backdrop-filter: blur(4px); animation: fadeIn 0.2s ease; }

.modal-content { max-width: 500px; width: 90%; position: relative; animation: slideInUp 0.3s ease-out; max-height: 90vh; overflow-y: auto; }
.modal-content.card { max-width: 700px; } 
.modal-content .form-grid-row { margin-bottom: 1rem; }
.modal-content #save-expense-changes-btn, .modal-content #create-settlement-btn { width: 100%; margin-top: 0.5rem; padding: 0.85rem; font-size: 1rem; }

.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; padding-right: 2rem; }
.modal-header h2 { margin-bottom: 0; font-size: 1.35rem; white-space: nowrap; }
.modal-date-picker { padding: 0.5rem 0.8rem; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-family); color: var(--text-main); font-size: 0.95rem; background: var(--side-bg); outline: none; transition: border-color 0.2s; width: 100%; max-width: 160px; cursor: pointer; }
.modal-date-picker:focus { border-color: var(--primary); background: #ffffff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

.close-modal-btn { position: absolute; top: 1rem; right: 1rem; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; transition: color 0.2s; z-index: 10; background: white; border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;}
.close-modal-btn:hover { color: var(--text-main); background: var(--app-bg); }
.currency-select-wrapper { margin-bottom: 1.5rem; }
.currency-select-wrapper label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.9rem;}

#exchange-rate-date { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
#exchange-rate-info .rate-item { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; font-size: 1rem;}
#exchange-rate-info .rate-item:not(:last-child) { border-bottom: 1px solid var(--app-bg); }
#exchange-rate-info .base { font-weight: 600; color: var(--primary); }

.rate-calc-box { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 1.5rem; }
.rate-row { display: flex; justify-content: space-between; padding: 1rem 1.2rem; background: #fff; align-items: center;}
.rate-row.base-row { background: #f8fafc; }
.rate-divider { text-align: center; background: #fff; color: var(--border); font-size: 1.2rem; margin-top: -12px; margin-bottom: -12px; position: relative; z-index: 2;}
.rate-divider i { background: #fff; padding: 0 15px; }
.currency-flag { font-weight: 600; font-size: 1.1rem; color: var(--text-muted); }
.currency-amount { font-weight: 700; font-size: 1.25rem; }
.calc-result-summary { background: #eef2ff; padding: 1rem; border-radius: 8px; text-align: center; }
.calc-result-summary p { margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--primary); }
.calc-result-numbers { display: flex; align-items: center; justify-content: center; gap: 0.8rem; font-size: 1.1rem; }
.calc-result-numbers .text-muted { color: var(--text-muted); text-decoration: line-through; font-size: 0.95rem; }
.calc-result-numbers i { color: var(--border); }
.calc-result-numbers .text-primary-bold { color: var(--text-main); font-weight: 800; }

.capture-mode { min-width: 800px !important; width: max-content !important; max-width: none !important; background: #ffffff !important; padding: 40px !important; box-sizing: border-box !important; }
.capture-mode .header-action-group, .capture-mode #exchange-rate-info-btn, .capture-mode #expense-form-card, .capture-mode .card-header button, .capture-mode th:last-child, .capture-mode td:last-child { display: none !important; }
.capture-mode i, .capture-mode .fas, .capture-mode .far, .capture-mode .fab { display: none !important; }
.capture-mode .settlement-header { flex-direction: row !important; align-items: center !important; border-bottom: 2px solid #e2e8f0 !important; padding-bottom: 1.5rem !important; margin-bottom: 2rem !important; }
.capture-mode #settlement-display { font-size: 2.2rem !important; white-space: nowrap !important; }
.capture-mode .card { border: none !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
.capture-mode #summary-card { padding: 2.5rem 2rem !important; border-radius: 12px !important; margin-bottom: 2.5rem !important; flex-direction: row !important; }
.capture-mode .summary-right { text-align: right !important; margin-top: 0 !important; }
.capture-mode #expense-table-container { overflow: visible !important; }
.capture-mode #expense-table { width: 100% !important; table-layout: auto !important; }
.capture-mode .clickable-amount { border-bottom: none !important; color: var(--text-main) !important; cursor: default !important; }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    #mobile-menu-btn { display: block; }
    #left-pane { width: 100% !important; max-height: 500px; overflow-y: auto; border-right: none; border-bottom: 1px solid var(--border); opacity: 1; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease; }
    #left-pane.collapsed { max-height: 0; opacity: 0; border-bottom-color: transparent; }
    .sidebar-content { width: 100%; }    
    #main-container { flex-direction: column; }
    #right-pane { padding: 1.5rem; }
    
    #calculator:not(.capture-mode) .settlement-header { flex-direction: column; align-items: flex-start; gap: 1rem;}
    #calculator:not(.capture-mode) .header-title-group { width: 100%; justify-content: space-between; }
    #calculator:not(.capture-mode) .header-action-group { width: 100%; display: grid; grid-template-columns: 1fr 1fr;}
    #calculator:not(.capture-mode) .header-action-group button { justify-content: center; }
    #calculator:not(.capture-mode) #summary-card { flex-direction: column; align-items: flex-start; }
    #calculator:not(.capture-mode) .summary-right { text-align: left; align-items: flex-start; margin-top: 1rem; }
    #calculator:not(.capture-mode) #final-settlement-container { text-align: left; }
    
    .form-grid-row { grid-template-columns: 1fr; }
    #add-settlement-fab { left: auto; right: 1.5rem; transform: none !important; }
    .settlement-item { padding: 0.8rem 1rem; font-size: 0.95rem; min-height: 52px; align-items: center; }
    
    .delete-settlement-btn, .leave-settlement-btn { width: 52px; height: 52px; }
    .delete-settlement-btn i, .leave-settlement-btn i { font-size: 1rem; }
    
    .modal-header { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
    .modal-date-picker { max-width: 100%; width: 100%; }

    header { padding: 0 1rem; }
    .brand-container h1 { display: none; }
    .header-controls { gap: 0.4rem; }
    
    #user-info-display { max-width: 120px; padding: 0.3rem 0.4rem; } 
    #user-email-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; max-width: 80px; }
    #auth-btn span { display: none; }
    #auth-btn { padding: 0.4rem 0.6rem; border: none !important; }
}
@keyframes slideInUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- Auth Page Specific Styles --- */
.auth-page-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background-color: var(--app-bg); padding: 1rem; position: relative; }
.auth-lang-selector { position: absolute; top: 1.5rem; right: 1.5rem; display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); }
.auth-card { width: 100%; max-width: 400px; background: white; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 2.5rem 2rem; animation: slideInUp 0.4s ease-out; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo img { width: 56px; height: 56px; margin-bottom: 0.5rem; object-fit: contain; }
.auth-logo h1 { font-size: 1.5rem; color: var(--primary); font-weight: 700; letter-spacing: -0.5px; margin: 0; }
.auth-card a { transition: opacity 0.2s; }
.auth-card a:hover { opacity: 0.7; }

/* --- UI Enhancements --- */
#global-loader { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(2px); display: flex; justify-content: center; align-items: center; z-index: 99999; }
.spinner { border: 4px solid rgba(99, 102, 241, 0.2); border-top: 4px solid var(--primary); border-radius: 50%; width: 48px; height: 48px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

#toast-container { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 100000; pointer-events: none; }
.toast { background: #333; color: white; padding: 12px 24px; border-radius: 50px; font-size: 0.95rem; font-weight: 500; display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); opacity: 0; transform: translateY(20px); transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background-color: #10b981; }
.toast-error { background-color: #ef4444; }
.toast-info { background-color: #3b82f6; }

/* --- Party & Membership Enhancements --- */
.item-badges { display: flex; gap: 4px; margin-bottom: 6px; }
.badge { font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.badge-host { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.badge-guest { background: #dcfce7; color: #059669; border: 1px solid #bbf7d0; }
.settlement-item.active .badge-host { background: rgba(255,255,255,0.2); color: white; border-color: transparent;}
.settlement-item.active .badge-guest { background: rgba(255,255,255,0.2); color: white; border-color: transparent;}
#join-room-btn { background-color: var(--secondary); border-color: var(--secondary); color: white; animation: pulse 2s infinite; }
#join-room-btn:hover { background-color: var(--secondary-hover); }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* 공유/참가 모달 스타일 */
.share-section { margin-bottom: 1.5rem; }
.share-section label { display: block; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.5rem; }
.share-input-group { display: flex; gap: 0.5rem; }
.share-input-group input { flex: 1; background: #f8fafc; cursor: text; font-family: monospace; font-size: 1rem; color: var(--primary); font-weight: 600; text-align: center; }
.share-input-group button { white-space: nowrap; }

/* 🚀 소셜 로그인 관련 스타일 추가 */
.social-login-container { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.5rem; }
.social-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem; border-radius: 8px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: opacity 0.2s; border: none; }
.social-btn:hover { opacity: 0.85; }
.social-btn.kakao { background-color: #FEE500; color: #191919; }
.social-btn.naver { background-color: #03C75A; color: white; }
.social-btn.line { background-color: #06C755; color: white; }
.social-btn.google { background-color: #ffffff; color: #3c4043; border: 1px solid #e2e8f0; }
.social-btn.apple { background-color: #000000; color: white; }
.naver-icon { font-weight: 900; font-style: normal; font-family: Arial, sans-serif; font-size: 1.1rem; }

.divider { display: flex; align-items: center; text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border); }
.divider:not(:empty)::before { margin-right: .8em; }
.divider:not(:empty)::after { margin-left: .8em; }