/* style.css - Toss Design System (TDS) Inspired Clean Theme */
:root {
    --bg-color: #ffffff;
    --bg-subtle: #f9fafb;
    --surface-gray: #f2f4f6;
    --border-color: #e5e8eb;
    --text-main: #191f28;
    --text-body: #333d4b;
    --text-sub: #4e5968;
    --text-muted: #8b95a1;
    --primary: #3182f6;
    --primary-hover: #1b64da;
    --primary-weak: #e8f3ff;
    --danger: #f04452;
    --danger-weak: #ffeeee;
    --input-focus: rgba(49, 130, 246, 0.16);
    --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.015em;
}

/* Top Navigation Bar */
.top-nav {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav-inner {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-block;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Top Notice Banner */
.notice-bar {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    padding: 0.65rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-sub);
}

.notice-badge {
    background: var(--danger-weak);
    color: var(--danger);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* Main Container */
.dashboard-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.75rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

/* Page Intro */
.page-intro {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.75rem;
}

.page-intro h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.6rem;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--text-sub);
    font-size: 0.98rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tag-item {
    background: var(--surface-gray);
    color: var(--text-sub);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
}

.badge-blue {
    background: var(--primary-weak);
    color: var(--primary);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.5rem;
    align-items: start;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 2.25rem;
}

/* Section Cards */
.glass-card {
    background: var(--bg-color);
}

.config-section {
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header {
    margin-bottom: 1.5rem;
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.section-desc {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.5;
}

/* Horizontal Form Row (Toss Style) */
.form-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row label {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-body);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    height: 46px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 3.75rem 0 0.95rem;
    color: var(--text-main);
    font-size: 0.92rem;
    font-family: var(--font-mono);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:hover {
    border-color: #b0b8c1;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus);
}

.btn-inline {
    position: absolute;
    right: 0.5rem;
    background: var(--surface-gray);
    color: var(--text-sub);
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-inline:hover {
    background: #e5e8eb;
    color: var(--text-main);
}

.readonly-wrapper input {
    background: var(--bg-subtle);
    color: var(--text-sub);
    cursor: default;
    padding-right: 4.5rem;
}

.status-pill {
    position: absolute;
    right: 0.6rem;
    background: var(--surface-gray);
    color: var(--text-sub);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
}

.amount-wrapper .currency-symbol {
    position: absolute;
    left: 0.95rem;
    color: var(--text-sub);
    font-weight: 600;
    font-size: 0.95rem;
}

.amount-wrapper input {
    padding-left: 2rem;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.98rem;
}

.select-wrapper select {
    width: 100%;
    height: 46px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 0.95rem;
    color: var(--text-main);
    font-size: 0.92rem;
    font-family: var(--font-sans);
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select-wrapper select:hover {
    border-color: #b0b8c1;
}

.select-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* Action Buttons */
.action-group {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.96rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.15s ease;
}

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

.btn-primary:disabled {
    background: #b0b8c1;
    cursor: not-allowed;
}

.btn-diagnose {
    width: 100%;
    height: 44px;
    background: var(--primary-weak);
    color: var(--primary-hover);
    border: none;
    border-radius: 10px;
    padding: 0 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-diagnose:hover {
    background: #d0e5ff;
}

.btn-diagnose:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--surface-gray);
    color: var(--text-body);
    border: none;
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.86rem;
    font-weight: 600;
    transition: background-color 0.15s ease;
}

.btn-secondary:hover {
    background: #e5e8eb;
}

/* Response / Log Panel */
.result-section {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-subtle);
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

.terminal-header {
    background: var(--bg-color);
    padding: 0.95rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.terminal-title {
    font-size: 0.92rem;
    color: var(--text-main);
    font-weight: 700;
}

.terminal-window {
    padding: 1.25rem;
    flex-grow: 1;
    background: var(--bg-subtle);
    overflow-y: auto;
}

.terminal-window pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.terminal-window code {
    font-family: var(--font-mono);
    font-size: 0.83rem;
    color: var(--text-body);
    line-height: 1.65;
}

/* Footer */
.dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.84rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.footer-credit {
    color: var(--text-sub);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-credit:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Guide Modal Styles */
.guide-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(25, 31, 40, 0.45);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.guide-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-content {
    width: 92%;
    max-width: 780px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    padding: 2.25rem;
    background: var(--bg-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.modal-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-main);
}

.guide-section {
    margin-top: 1.5rem;
}

.guide-section h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.02rem;
    font-weight: 700;
}

.guide-section p {
    margin-bottom: 0.75rem;
    color: var(--text-sub);
    line-height: 1.6;
    font-size: 0.92rem;
}

.guide-section pre {
    background: var(--bg-subtle);
    padding: 1.15rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    margin-bottom: 1.15rem;
}

.guide-section code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-body);
    line-height: 1.55;
}

.warning-box {
    background: var(--danger-weak);
    border-left: 4px solid var(--danger);
    padding: 1rem 1.15rem;
    border-radius: 0 8px 8px 0;
    color: var(--text-body);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-top: 1rem;
}

/* Responsive Styles */
@media (max-width: 920px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
}