* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8c 100%);
    min-height: 100vh;
    padding: 40px 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    color: white;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.5em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.flow-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.flow-card {
    background: white;
    border-radius: 18px;
    padding: 25px;
    text-decoration: none;
    color: #333;
    border: 3px solid #ddd;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flow-card:hover {
    border-color: #e8601c;
    box-shadow: 0 8px 25px rgba(232, 96, 28, 0.2);
}

.step {
    background: white;
    border-radius: 18px;
    padding: 25px;
    text-decoration: none;
    color: #333;
    border: 3px solid #ddd;
    transition: opacity 0.3s ease, margin 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    min-height: 120px;
    display: none;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    margin-bottom: 0;
}

.step.visible {
    display: flex;
    opacity: 1;
    margin-bottom: 60px;
    pointer-events: auto;
}

.step::after {
    display: none;
}

.step:last-child::after,
.step.finalizar::after {
    display: none !important;
}

.flow-card:hover,
.step:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.step-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 10px;
}

.step.active {
    border-color: #e8601c;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    box-shadow: 0 0 20px rgba(232, 96, 28, 0.25);
    border-width: 4px;
}

.step.active .step-title {
    font-weight: 700;
    color: #d84315;
}

.step.next {
    border-color: #1e3a5f;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    box-shadow: 0 0 20px rgba(30, 58, 95, 0.15);
}

.arrow {
    display: none;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(8px);
    }
}

.step.next .arrow {
    display: none;
}

.info {
    background: white;
    padding: 25px;
    border-radius: 16px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-size: 1.1em;
    color: #666;
}

.options {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    flex-wrap: wrap;
}

.option-btn {
    border: none;
    background: linear-gradient(135deg, #e8601c 0%, #d84315 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 4px 10px rgba(232, 96, 28, 0.3);
    position: relative;
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(232, 96, 28, 0.5);
}

.option-btn:active {
    transform: translateY(0);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn-primary {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #455a64 0%, #37474f 100%);
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.95rem;
}

.criador-container {
    padding: 30px 20px 40px;
}

.criador-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.criador-section {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.criador-section h2 {
    margin-bottom: 18px;
    color: white;
    font-size: 1.65rem;
}

.form-group {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.form-group label {
    color: white;
    font-weight: 600;
}

.form-group input,
.form-group select,
.json-preview textarea,
.option-editor input,
.option-editor select {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.92);
    font-size: 1rem;
    color: #333;
}

.form-group small {
    color: #ddd;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 20px;
}

.step-editor {
    padding: 18px;
    border-radius: 18px;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

.step-header {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.step-header input {
    width: 100%;
}

.step-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #333;
    font-weight: 600;
}

.step-controls input[type="checkbox"] {
    width: auto;
}

.step-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-editor {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: center;
}

.option-editor input,
.option-editor select {
    min-width: 0;
}

.btn-delete,
.btn-delete-option {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
    color: white;
    border-radius: 12px;
    min-width: 48px;
}

.btn-delete-option {
    padding: 0 12px;
}

.json-preview textarea {
    min-height: 200px;
    resize: vertical;
    font-family: Consolas, 'Courier New', monospace;
}

.action-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.criador-content .btn {
    min-width: 160px;
}

@media (max-width: 840px) {
    .step-header,
    .option-editor {
        grid-template-columns: 1fr;
    }

    .step-controls {
        justify-content: flex-start;
    }
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.btn:active {
    transform: translateY(0);
}

.btn-danger,
.btn-delete {
    background: linear-gradient(135deg, #d32f2f 0%, #c62828 100%);
}

.btn-success {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.header-back {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.back-header {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.admin-status {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
    margin-top: 8px;
}

.admin-login-form {
    max-width: 420px;
    margin: 40px auto 0;
    padding: 30px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.admin-login-form form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.admin-login-form label {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: white;
    font-weight: 600;
}

.admin-login-form input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.92);
    font-size: 1em;
}

.admin-login-form .btn {
    width: 100%;
}

.back-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #e8601c 0%, #d84315 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1em;
    box-shadow: 0 6px 20px rgba(232, 96, 28, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(232, 96, 28, 0.6);
}

.back-btn:active {
    transform: translateY(-1px);
}

.flows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sector-card {
    text-align: center;
}

.sector-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.header-back {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.back-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8c 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.back-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

@media (max-width: 768px) {
    body {
        padding: 30px 15px;
    }

    h1 {
        font-size: 2em;
        margin-bottom: 20px;
    }

    .container {
        max-width: 100%;
    }

    .flow-grid {
        gap: 10px;
    }

    .step {
        padding: 20px;
        min-height: 100px;
    }

    .step.visible {
        margin-bottom: 20px;
    }

    .step-title {
        font-size: 1.1em;
    }

    .options {
        gap: 10px;
    }

    .option-btn {
        padding: 10px 16px;
        font-size: 0.9em;
        width: 100%;
    }

    .flows-grid {
        grid-template-columns: 1fr;
    }

    .back-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 18px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }

    h1 {
        font-size: 1.5em;
    }

    .step {
        padding: 15px;
        min-height: 80px;
    }

    .step-title {
        font-size: 1em;
    }

    .option-btn {
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .back-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 15px;
        font-size: 0.8em;
    }
}