/* Light Mode Variables */
:root {
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
}

/* Or if you use a .dark class */
.dark {
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
}

/* ===== TENSEAL ESCROW ENGINE STYLES ===== */
.escrow-container {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
    padding-top: 20px;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    z-index: 0;
}

.progress-bar-fill {
    position: absolute;
    top: 40px;
    left: 0;
    height: 3px;
    background: var(--accent-primary);
    z-index: 1;
    transition: width 0.3s ease;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
    flex: 1;
}

.progress-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-tertiary);
    transition: all 0.3s ease;
}

.progress-step.active .progress-step-circle {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--primary-black);
}

.progress-step.completed .progress-step-circle {
    background: #22C55E;
    border-color: #22C55E;
    color: white;
}

.progress-step-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    font-weight: 700;
    text-align: center;
}

.progress-step.active .progress-step-label { 
    color: var(--accent-primary); 
}

.progress-step.completed .progress-step-label { 
    color: #22C55E; 
}

/* ===== FORM STEPS ===== */
.form-step {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.form-step.active {
    display: block;
}

/* ===== FORM ELEMENTS ===== */
.form-group { 
    margin-bottom: 1.5rem; 
}

.form-label { 
    display: block; 
    margin-bottom: 0.5rem; 
    font-weight: 700; 
    color: var(--text-primary); 
    font-size: 0.85rem; 
    text-transform: uppercase; 
}

.form-label.required::after { 
    content: '*'; 
    color: #EF4444; 
    margin-left: 0.25rem; 
}

.form-input, .form-select, .form-textarea {
    width: 100%; 
    padding: 0.875rem 1rem; 
    background: var(--input-bg);
    border: 1px solid var(--input-border); 
    border-radius: 10px;
    color: var(--text-primary); 
    font-size: 0.95rem; 
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2310bfff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; 
    border-color: var(--accent-primary); 
    background: var(--bg-hover);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Info card spacing */
.info-card {
    margin-bottom: 2rem;
}

/* ===== LOOKUP FIELD (70/30 SPLIT) ===== */
.lookup-container { 
    display: flex; 
    gap: 10px; 
}

.lookup-field { 
    flex: 0 0 75%; 
}

.lookup-btn { 
    flex: 1; 
    height: 50px !important; 
    margin: 0 !important; 
}

/* ===== SELECTABLE RADIO OPTIONS ===== */
.radio-group { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}

.radio-group.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.selectable-option {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 15px;
    background: var(--bg-tertiary); 
    border: 2px solid var(--border-color);
    border-radius: 12px; 
    cursor: pointer; 
    transition: all 0.2s ease;
}

.selectable-option:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.selectable-option.active { 
    border-color: var(--accent-primary); 
    background: rgba(16, 191, 255, 0.1); 
}

.selectable-option i { 
    color: var(--accent-primary); 
    font-size: 1.2rem; 
}

/* ===== CHECKBOX OPTIONS (VERTICAL STACK) ===== */
.checkbox-group-vertical { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.checkbox-option { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 12px 15px;
    background: var(--bg-tertiary); 
    border: 1px solid var(--border-color);
    border-radius: 10px; 
    cursor: pointer; 
    transition: all 0.2s ease;
}

.checkbox-option:hover { 
    background: var(--bg-hover); 
    border-color: var(--accent-primary);
}

.checkbox-option input[type="checkbox"] { 
    width: 18px; 
    height: 18px; 
    cursor: pointer; 
    accent-color: var(--accent-primary);
}

.opt-desc { 
    color: var(--text-tertiary); 
    font-size: 0.8rem; 
    margin-left: auto; 
    font-style: italic;
}

/* ===== FEE SPLIT SLIDER ===== */
.fee-split-box { 
    background: var(--bg-tertiary); 
    padding: 25px; 
    border-radius: 15px; 
    margin: 20px 0; 
    border: 1px solid var(--border-color); 
}

.split-top-labels { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 5px; 
    color: var(--text-primary); 
    font-weight: 800; 
    font-size: 0.9rem; 
}

.split-bottom-percents { 
    display: flex; 
    justify-content: space-between; 
    margin-top: 5px; 
    color: var(--accent-primary); 
    font-weight: 700; 
    font-size: 1rem; 
}

.split-range { 
    width: 100%; 
    margin: 15px 0; 
    accent-color: var(--accent-primary); 
    cursor: pointer;
    height: 8px;
}

/* ===== BUTTON ALIGNMENT ===== */
.form-actions { 
    display: flex; 
    gap: 15px; 
    margin-top: 30px; 
}

.form-actions .btn { 
    flex: 1; 
    height: 50px !important; 
    font-weight: 700; 
    border-radius: 12px; 
}

/* ===== REVIEW SUMMARY BLOCKS ===== */
.summary-block { 
    background: var(--bg-secondary); 
    border: 1px solid var(--border-color); 
    border-radius: 15px; 
    margin-bottom: 20px; 
    overflow: hidden; 
}

.summary-header { 
    background: var(--bg-tertiary); 
    padding: 12px 20px; 
    border-bottom: 1px solid var(--border-color); 
    font-weight: 800; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.summary-body { 
    padding: 20px; 
}

.summary-item { 
    display: flex; 
    justify-content: space-between; 
    padding: 8px 0; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item label { 
    color: var(--text-tertiary); 
    font-size: 0.9rem; 
}

.summary-item span { 
    color: var(--text-primary); 
    font-weight: 600; 
}

.total-box { 
    background: var(--bg-primary); 
    padding: 20px; 
    border-radius: 12px; 
    border: 1px solid var(--accent-primary); 
    margin-top: 15px; 
    text-align: center; 
}

.total-box strong {
    font-size: 1.2rem;
    color: var(--accent-primary);
}

/* ===== TERMS CHECKBOX ===== */
.terms-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.terms-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.terms-check label {
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .radio-group.three-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .form-step { 
        padding: 1.5rem; 
        border: none; 
        background: transparent; 
    }
    
    .radio-group { 
        grid-template-columns: 1fr; 
    }
    
    .form-actions { 
        flex-direction: column-reverse; 
    }

    .lookup-container {
        flex-direction: column;
    }

    .lookup-field {
        flex: 1;
    }
}

/* ===== ADDITIONAL ENHANCEMENTS (Add to existing file) ===== */

/* Form hints */
.form-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
    font-style: italic;
}

/* Disabled state for inputs */
.form-input:disabled,
.lookup-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button small variant */
.btn-sm {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    height: auto !important;
}

/* Lookup result messages */
#lookup_res > div {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

#lookup_res i {
    font-size: 1rem;
}

/* Row layout for side-by-side inputs */
.row {
    display: flex;
    gap: 15px;
    margin-bottom: 1.5rem;
}

.row .col {
    flex: 1;
}


/* Loading state for submit button */
.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary:disabled i.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Info card styling */
.info-card {
    background: linear-gradient(135deg, rgba(16, 191, 255, 0.1), rgba(16, 191, 255, 0.05));
    border-left: 4px solid var(--accent-primary);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.info-card i {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

/* Character counter for textareas */
.char-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
}

/* Input with icon (for amount field) */
.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent-primary);
    font-weight: 700;
    pointer-events: none;
}

.form-input.with-icon {
    padding-left: 2.5rem;
}

/* Mobile improvements */
@media (max-width: 600px) {
    .row {
        flex-direction: column;
    }
    
    .progress-bar-fill {
        top: 35px;
    }
    
    .progress-bar::before {
        top: 35px;
    }
    
    .progress-step-circle {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .progress-step-label {
        font-size: 0.65rem;
    }
}

/* Focus states for accessibility */
.selectable-option:focus-within {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.checkbox-option:focus-within {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Empty state for lookup */
.lookup-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-tertiary);
    font-style: italic;
}



/* ===== SUPER COMPACT USER FOUND - MODERN MOBILE ===== */
.compact-user-wrapper {
    margin-top: 12px;
    animation: slideInScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.compact-user-found {
    background: linear-gradient(135deg, rgba(16, 191, 255, 0.08), rgba(16, 191, 255, 0.03));
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    position: relative;
}

.compact-user-found:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 191, 255, 0.12);
}

.compact-user-avatar,
.compact-user-avatar-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
}

.compact-user-avatar {
    object-fit: cover;
    border: 2px solid var(--accent-primary);
}

.compact-user-avatar-placeholder {
    background: linear-gradient(135deg, var(--accent-primary), #0ea5e9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-black);
    border: 2px solid var(--accent-primary);
    letter-spacing: 0.5px;
}

.compact-user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.compact-user-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    line-height: 1.2;
}

.compact-user-id {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.compact-user-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.compact-user-clear:hover {
    background: #EF4444;
    border-color: #EF4444;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.compact-user-clear:active {
    transform: rotate(90deg) scale(0.95);
}

/* Change Partner Button */
.compact-user-change-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compact-user-change-btn:hover {
    background: rgba(16, 191, 255, 0.08);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 191, 255, 0.15);
}

.compact-user-change-btn:active {
    transform: translateY(0);
}

.compact-user-change-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.compact-user-change-btn:hover i {
    transform: rotate(180deg);
}

/* Dark Mode Enhancements */
[data-theme="dark"] .compact-user-found,
.dark .compact-user-found {
    background: linear-gradient(135deg, rgba(16, 191, 255, 0.12), rgba(16, 191, 255, 0.05));
    border-color: rgba(16, 191, 255, 0.6);
}

[data-theme="dark"] .compact-user-found:hover,
.dark .compact-user-found:hover {
    box-shadow: 0 4px 16px rgba(16, 191, 255, 0.25);
}

[data-theme="dark"] .compact-user-clear,
.dark .compact-user-clear {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .compact-user-clear:hover,
.dark .compact-user-clear:hover {
    background: #DC2626;
    border-color: #DC2626;
}

[data-theme="dark"] .compact-user-change-btn,
.dark .compact-user-change-btn {
    background: rgba(16, 191, 255, 0.08);
    border-color: rgba(16, 191, 255, 0.3);
}

[data-theme="dark"] .compact-user-change-btn:hover,
.dark .compact-user-change-btn:hover {
    background: rgba(16, 191, 255, 0.15);
    border-color: rgba(16, 191, 255, 0.6);
}

/* Mobile Optimizations */
@media (max-width: 600px) {
    .compact-user-found {
        padding: 12px 14px;
        gap: 12px;
        border-radius: 10px;
    }
    
    .compact-user-avatar,
    .compact-user-avatar-placeholder {
        width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }
    
    .compact-user-name {
        font-size: 0.9rem;
    }
    
    .compact-user-id {
        font-size: 0.72rem;
    }
    
    .compact-user-clear {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
        top: 6px;
        right: 6px;
    }
    
    .compact-user-change-btn {
        padding: 9px 14px;
        font-size: 0.8rem;
    }
    
    .compact-user-change-btn i {
        font-size: 0.8rem;
    }
}

/* Extra small screens */
@media (max-width: 375px) {
    .compact-user-found {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .compact-user-avatar,
    .compact-user-avatar-placeholder {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }
    
    .compact-user-name {
        font-size: 0.85rem;
    }
    
    .compact-user-id {
        font-size: 0.7rem;
    }
    
    .compact-user-change-btn {
        padding: 8px 12px;
        font-size: 0.78rem;
    }
}

/* Accessibility */
.compact-user-clear:focus-visible,
.compact-user-change-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Loading state */
.compact-user-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}