/* ═══════════════════════════════════════════════════════════════
   Crypto Exchanger — CSS v3
   Palette: #FF7A00 (orange) · #00C2D8 (teal) · #0F1720 (dark) · #1C2430 (graphite)
   IMPORTANT: Panel show/hide is done via JS inline styles ONLY.
              CSS here is purely visual — no display rules for panels.
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────── */
#cex-exchanger {
    --co:  #FF7A00;
    --ct:  #00C2D8;
    --cd:  #0F1720;
    --cg:  #1C2430;
    --cb:  rgba(0,194,216,0.15);
    --ctx: #e8eef4;
    --cm:  #6b7c8d;
    --ce:  #ff5555;
    --cs:  #00e5a0;
    --r:   12px;
    --tr:  0.2s ease;
}

/* ── Reset for plugin elements ────────────────────────────────── */
#cex-exchanger,
#cex-exchanger * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    line-height: normal;
}

/* ── Wrapper ──────────────────────────────────────────────────── */
#cex-exchanger {
    max-width: 560px;
    margin: 30px auto;
    background: var(--cd);
    border-radius: 20px;
    padding: 28px 26px 26px;
    color: var(--ctxt);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: var(--ctx);
    box-shadow: 0 0 0 1px var(--cb), 0 12px 50px rgba(0,0,0,0.6), 0 0 90px rgba(255,122,0,0.06);
    position: relative;
}

/* ── Header ───────────────────────────────────────────────────── */
.cex-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.cex-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #FF7A00, #FFAA00);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(255,122,0,0.4);
}
.cex-logo-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ctx);
    display: block;
}
.cex-logo-sub {
    font-size: 0.68rem;
    color: var(--cm);
    display: block;
    margin-top: 2px;
}

/* ── Step indicators ──────────────────────────────────────────── */
.cex-steps {
    display: flex;
    align-items: center;
    margin-bottom: 26px;
    gap: 0;
}
.cex-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    min-width: 58px;
    opacity: 0.38;
    transition: opacity var(--tr);
}
.cex-step.cex-step-active,
.cex-step.cex-step-done { opacity: 1; }

.cex-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cg);
    border: 2px solid rgba(255,255,255,0.1);
    color: var(--cm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background var(--tr), color var(--tr), border-color var(--tr);
}
.cex-step.cex-step-active .cex-step-circle {
    background: linear-gradient(135deg, #FF7A00, #FFAA00);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 18px rgba(255,122,0,0.5);
}
.cex-step.cex-step-done .cex-step-circle {
    background: #00C2D8;
    color: #0F1720;
    border-color: transparent;
    font-size: 0;
}
.cex-step.cex-step-done .cex-step-circle::after {
    content: '✓';
    font-size: 0.85rem;
    font-weight: 900;
}

.cex-step-label {
    font-size: 0.62rem;
    color: var(--cm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    white-space: nowrap;
}
.cex-step.cex-step-active .cex-step-label { color: #FF7A00; }
.cex-step.cex-step-done   .cex-step-label { color: #00C2D8; }

.cex-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.08);
    margin-bottom: 18px;
    min-width: 10px;
    transition: background var(--tr);
}
.cex-step-line.cex-line-done {
    background: linear-gradient(90deg, #FF7A00, #00C2D8);
}

/* ── Panel (no display rules — JS controls that) ──────────────── */
.cex-panel {
    animation: cexSlideIn 0.22s ease;
}
@keyframes cexSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Panel title ──────────────────────────────────────────────── */
.cex-panel-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--ctx);
    margin-bottom: 20px;
    display: block;
}

/* ── Direction 3-column row ───────────────────────────────────── */
.cex-row-3col {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    align-items: end;
    gap: 10px;
    margin-bottom: 4px;
}
.cex-col-center {
    display: flex;
    justify-content: center;
    padding-bottom: 3px;
}

/* ── Field ────────────────────────────────────────────────────── */
.cex-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 16px;
}
.cex-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
}

/* ── Select & Input ───────────────────────────────────────────── */
.cex-select,
.cex-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--cg);
    border: 1.5px solid rgba(0,194,216,0.18);
    border-radius: var(--r);
    color: var(--ctx);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--tr), box-shadow var(--tr);
    -webkit-appearance: none;
    appearance: none;
}
.cex-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%2300C2D8' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 34px;
    cursor: pointer;
}
.cex-select:focus,
.cex-input:focus {
    border-color: #00C2D8;
    box-shadow: 0 0 0 3px rgba(0,194,216,0.15);
}
.cex-input::placeholder { color: var(--cm); }

/* Hide spinner arrows on number-like inputs */
.cex-input::-webkit-inner-spin-button,
.cex-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Select options */
.cex-select option         { background: #1C2430; color: #e8eef4; }
.cex-select option:disabled { color: #445060; }

/* ── Swap button ──────────────────────────────────────────────── */
.cex-swap-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,194,216,0.25);
    background: var(--cg);
    color: #00C2D8;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tr), transform 0.35s ease, box-shadow var(--tr);
    padding: 0;
    line-height: 1;
}
.cex-swap-btn:hover {
    background: #00C2D8;
    color: #0F1720;
    box-shadow: 0 0 18px rgba(0,194,216,0.4);
}
.cex-swap-btn:active { transform: rotate(180deg); }

/* ── Direction badge (step 2) ─────────────────────────────────── */
.cex-badge {
    background: rgba(0,194,216,0.08);
    border: 1px solid rgba(0,194,216,0.2);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 0.88rem;
    color: #00C2D8;
    font-weight: 700;
    margin-bottom: 18px;
}

/* ── Hint ─────────────────────────────────────────────────────── */
.cex-hint {
    font-size: 0.72rem;
    color: var(--cm);
    display: block;
}

/* ── Error ────────────────────────────────────────────────────── */
.cex-error {
    background: rgba(255,85,85,0.1);
    border: 1px solid rgba(255,85,85,0.3);
    border-left: 3px solid var(--ce);
    color: #ff8888;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 0.82rem;
    margin-bottom: 14px;
}

/* ── Actions ──────────────────────────────────────────────────── */
.cex-actions {
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 6px;
    display: flex;
    justify-content: flex-end;
}
.cex-actions-2col {
    justify-content: space-between;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.cex-btn {
    padding: 11px 24px;
    border: none;
    border-radius: var(--r);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: filter var(--tr), box-shadow var(--tr), transform 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.02em;
}
.cex-btn:active { transform: scale(0.97); }

.cex-btn-primary {
    background: linear-gradient(135deg, #FF7A00 0%, #FFAA00 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(255,122,0,0.35);
}
.cex-btn-primary:hover  { filter: brightness(1.08); box-shadow: 0 6px 24px rgba(255,122,0,0.5); }
.cex-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; filter: none; box-shadow: none; }

.cex-btn-secondary {
    background: var(--cg);
    color: var(--cm);
    border: 1.5px solid rgba(255,255,255,0.08);
}
.cex-btn-secondary:hover { color: var(--ctx); border-color: rgba(0,194,216,0.4); }

/* ── Summary ──────────────────────────────────────────────────── */
.cex-summary {
    background: var(--cg);
    border: 1px solid var(--cb);
    border-radius: var(--r);
    overflow: hidden;
    margin-bottom: 20px;
}
.cex-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cex-summary-row:last-child { border-bottom: none; }
.cex-summary-key {
    font-size: 0.8rem;
    color: var(--cm);
    font-weight: 600;
}
.cex-summary-val {
    font-size: 0.95rem;
    font-weight: 700;
    color: #00C2D8;
}

/* ── Success ──────────────────────────────────────────────────── */
.cex-success {
    text-align: center;
    padding: 40px 20px 32px;
}
.cex-success-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
    animation: cexPop 0.4s cubic-bezier(0.36,2,0.6,1) both;
}
@keyframes cexPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.cex-success-msg {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--cs);
    line-height: 1.55;
    display: block;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    #cex-exchanger { padding: 20px 16px; border-radius: 16px; }
    .cex-row-3col  { grid-template-columns: 1fr; }
    .cex-col-center { padding: 0; }
    .cex-swap-btn { margin: 0 auto; transform: rotate(90deg); }
    .cex-swap-btn:active { transform: rotate(270deg); }
    .cex-step-label { display: none; }
    .cex-actions,
    .cex-actions-2col { flex-direction: column-reverse; gap: 8px; }
    .cex-btn { width: 100%; justify-content: center; }
}
