/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #020617 100%);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.15);
    --primary-hover: #4f46e5;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --success-hover: #059669;

    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --glass-bg: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(99, 102, 241, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --backdrop-blur: blur(12px);

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* Background Decorative Elements */
.background-decor {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    right: -50px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: #06b6d4;
    bottom: -150px;
    left: -100px;
}

/* ==========================================================================
   LAYOUT CONTAINER
   ========================================================================== */
.app-container {
    width: 100%;
    max-width: 680px;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-wrapper {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--backdrop-blur);
}

.logo-img {
    height: 55px;
    width: auto;
    object-fit: contain;
}

.app-title {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.app-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Card Styling (Glassmorphism) */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--glass-shadow);
    backdrop-filter: var(--backdrop-blur);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
}

/* ==========================================================================
   PROGRESS STEPS
   ========================================================================== */
.progress-bar-container {
    margin-bottom: 2.5rem;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    text-align: center;
}

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    margin-bottom: 0.5rem;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.step-indicator.active .step-num {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 0 15px var(--primary-glow);
}

.step-indicator.active .step-label {
    color: var(--text-primary);
}

.step-indicator.completed .step-num {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
    box-shadow: 0 0 15px var(--success-glow);
}

.step-indicator.completed .step-label {
    color: var(--success);
}

.progress-bar-track {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    top: -38px;
    width: calc(100% - 60px);
    margin: 0 auto;
    z-index: 1;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary), var(--success));
    border-radius: 2px;
    transition: var(--transition-smooth);
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */
.form-step {
    display: none;
}

.form-step.active-step {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-header {
    margin-bottom: 2rem;
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.step-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-row {
    display: flex;
    gap: 1.25rem;
}

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

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.required {
    color: var(--danger);
    margin-left: 2px;
}

input[type="text"],
input[type="number"],
input[type="email"],
select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--glass-border-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: rgba(15, 23, 42, 0.6);
}

/* Error States */
input.error,
select.error {
    border-color: var(--danger) !important;
}

input.error:focus,
select.error:focus {
    box-shadow: 0 0 0 4px var(--danger-glow) !important;
}

.error-msg {
    display: block;
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 0.4rem;
    height: 14px;
    font-weight: 500;
}

/* Currency Wrapper */
.currency-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.currency-input-wrapper input {
    padding-left: 2.6rem;
}

/* ==========================================================================
   CONDITIONAL SECTIONS
   ========================================================================== */
.conditional-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-lg);
    padding: 0;
    border: 1px solid transparent;
}

.conditional-section.show {
    max-height: 1500px; /* high enough for dynamic contents */
    opacity: 1;
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-color: var(--glass-border);
}

.section-title-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.form-divider {
    border: 0;
    height: 1px;
    background: var(--glass-border);
    margin: 1.75rem 0;
}

/* ==========================================================================
   DYNAMIC PARTNERS SECTION
   ========================================================================== */
.socios-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.socios-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.socio-card {
    background: rgba(15, 23, 42, 0.4);
    border: 1.5px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.socio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.socio-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.btn-remove-socio {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-remove-socio:hover {
    color: var(--danger);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    outline: none;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.78rem;
    border-radius: var(--border-radius-sm);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--glass-border);
}

.btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.step-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.step-actions button {
    min-width: 120px;
}

/* ==========================================================================
   RESULT DISPLAY & JSON VIEWER
   ========================================================================== */
.result-section {
    display: none;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.success-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    border: 2px solid var(--success);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px var(--success-glow);
}

.success-svg {
    fill: var(--success);
    width: 32px;
    height: 32px;
}

.result-header h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

.result-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.json-viewer-card {
    background: rgba(10, 15, 30, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    text-align: left;
    margin-bottom: 2rem;
    overflow: hidden;
}

.json-viewer-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: inherit;
}

.json-viewer-header span {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.btn-copy {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition-smooth);
}

.btn-copy:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.copy-svg {
    fill: currentColor;
}

pre {
    padding: 1.25rem;
    margin: 0;
    overflow-x: auto;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88rem;
    color: #38bdf8;
    line-height: 1.5;
}

.result-actions {
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 600px) {
    .card {
        padding: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .step-label {
        display: none;
    }
    
    .progress-bar-track {
        top: -20px;
    }
    
    .app-title {
        font-size: 1.8rem;
    }
}
