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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0b0e11;
    color: #eaecef;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 480px;
}

h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 20px;
    color: #f0b90b;
}

.card {
    background: #1e2329;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #f0b90b;
}

/* Toggle switch for trading mode */
.mode-toggle {
    display: flex;
    background: #2b3139;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.mode-toggle label {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    color: #848e9c;
}

.mode-toggle input[type="radio"] {
    display: none;
}

.mode-toggle input[type="radio"]:checked + label {
    background: #f0b90b;
    color: #0b0e11;
}

/* Form rows */
.form-group {
    margin-bottom: 14px;
}

.form-group > label {
    display: block;
    font-size: 12px;
    color: #848e9c;
    margin-bottom: 6px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 10px 12px;
    background: #2b3139;
    border: 1px solid #3c4043;
    border-radius: 6px;
    color: #eaecef;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    border-color: #f0b90b;
}

/* Inline input + select row */
.input-with-select {
    display: flex;
    gap: 8px;
}

.input-with-select input {
    flex: 1;
}

.input-with-select select {
    width: 140px;
    flex-shrink: 0;
}

/* Read-only info rows */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #2b3139;
}

.info-row .info-label {
    color: #848e9c;
}

.info-row .info-value {
    color: #eaecef;
    font-weight: 500;
}

/* Collapsible section */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 12px 0;
    user-select: none;
}

.collapsible-header h3 {
    font-size: 14px;
    color: #848e9c;
}

.chevron {
    font-size: 12px;
    color: #848e9c;
    transition: transform 0.3s;
}

.chevron.open {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.collapsible-content.open {
    max-height: 800px;
}

/* Checkbox rows */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.checkbox-row input[type="checkbox"] {
    accent-color: #f0b90b;
    width: 16px;
    height: 16px;
}

.sub-fields {
    margin-left: 24px;
    margin-bottom: 10px;
}

.sub-fields .form-group {
    margin-bottom: 8px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-bottom: 8px;
}

.btn:hover {
    opacity: 0.85;
}

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

.btn-primary {
    background: #f0b90b;
    color: #0b0e11;
}

.btn-secondary {
    background: #2b3139;
    color: #eaecef;
    border: 1px solid #3c4043;
}

.btn-connect {
    background: #02c076;
    color: #fff;
}

/* Status indicators */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green {
    background: #02c076;
}

.status-dot.red {
    background: #f6465d;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #3c4043;
    border-top-color: #f0b90b;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result box */
.result-box {
    background: #2b3139;
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-box.success {
    border-left: 3px solid #02c076;
}

.result-box.error {
    border-left: 3px solid #f6465d;
}

/* Divider */
.divider {
    height: 1px;
    background: #2b3139;
    margin: 20px 0;
}

/* Radio group */
.radio-group {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    accent-color: #f0b90b;
}

.hidden {
    display: none !important;
}

/* Profit display */
.profit-display {
    font-size: 14px;
    color: #02c076;
    font-weight: 500;
    padding: 8px 0;
}

/* TP/SL mode selector */
.tpsl-mode-selector {
    display: flex;
    background: #2b3139;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tpsl-mode-selector label {
    flex: 1;
    text-align: center;
    padding: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #848e9c;
    transition: background 0.2s;
}

.tpsl-mode-selector input[type="radio"] {
    display: none;
}

.tpsl-mode-selector input[type="radio"]:checked + label {
    background: #3c4043;
    color: #eaecef;
}
